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.