Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Get current active view_id

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
refreshview_idreload
1 Responder
15317 Vistas
Avatar
Munesh Nandwani

Is there a way to get the current active view_id? I need to refresh the page according to the active form that user are viewing. Or is there a way for me to refresh 2 or more page? (parent and wizard view)

I have tried:

@api.multi
def refresh_ot(self, activity):

    ir_model_data = self.env['ir.model.data']
    form_res = self.env.ref('mrp_employee_relation.mrp_employee_activity_form_view')
    tree_res = self.env.ref('mrp_employee_relation.mrp_employee_activity_tree_view')

return { 'view_mode': 'form', 'view_type': 'form', 'res_model': 'mrp.employee.activity', 'res_id' : activity.id, 'view_id' : False, 'views' : [(form_res.id, 'form'), (tree_res.id, 'tree')], 'type' : 'ir.actions.act_window', }


@api.multi
 def refresh_plat(self, plating):
    ir_model_data = self.env['ir.model.data']
    form_res = self.env.ref('mrp_employee_relation.mrp_plating_report_form_view')
    tree_res = self.env.ref('mrp_employee_relation.mrp_plating_report_tree_view')

return { 'view_mode': 'form', 'view_type': 'form', 'res_model': 'mrp.plating.report', 'res_id' : plating.id, 'view_id' : False, 'views' : [(form_res.id, 'form'), (tree_res.id, 'tree')], 'type' : 'ir.actions.act_window', }


Then I call both function at Return, this method only work if I am in wizard view and it wont work if I am using the parent view while pressing a object button. 



0
Avatar
Descartar
Avatar
Jignesh Mehta
Mejor respuesta

Hello Munesh Nandwani,


Try below code.


@api.multi

def refresh_plat(self, plating):

     model_obj = self.env['ir.model.data']

     data_id = model_obj._get_id('module_name', 'view_id_which_you_want_refresh')

     view_id = model_obj.browse(data_id).res_id

     return {

         'type': 'ir.actions.client',

         'tag': 'reload',               

         'name': _('View Name'),               

         'res_model': 'model_name',               

         'view_type': 'view type which is kanban, form',               

         'view_mode': 'view mode which is kanban, form',               

         'view_id': view_id,               

         'target': 'current',               

         'nodestroy': True,

     }


Hope it will works for you.

Thanks,


0
Avatar
Descartar
Munesh Nandwani
Autor

Hi Jignesh Metha,

Thank you for you reply. But it's not the solution that I am looking for. I wish I can upload a picture to have a clearer view of the situation.

What happen is, In From Employee Activity I have one2many of Plating. In that one2many tree I have a button name "start". If u click the one2many it will pop up a wizard that will have the same button (start).

If use the button inside the wizard and I call both refresh function. It work properly. But if I use the button inside the one2many (without having a pop out wizard) it will not refresh properly (it only refresh that one2many not other one2many that are created because of that start button).

So If i can find out currently the user is using the start button from wizard view or not wizard view I can call the function accordingly. I hope this clarifies my question. Thank you.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
How to refresh page to update menu items ? Resuelto
menu page refresh reload
Avatar
Avatar
1
oct 25
8452
Need to refresh or reload the Purchase order from Purchase order line odoo 10
python2.7 refresh reload odoo10
Avatar
Avatar
1
ago 17
6371
Trigger reload One2many treeview
treeview onchange refresh reload
Avatar
0
jul 16
5221
Reload or refresh the page/form on field change
code form refresh reload odoo16features
Avatar
Avatar
Avatar
2
ago 24
10508
Refresh/reload a Many2many field view when updating a record with active=False
view many2many edit refresh reload
Avatar
0
feb 22
5972
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now