Skip to Content
Menu
This question has been flagged
1 Reply
5526 Views

I am trying to execute an action after a wizard action is performed, i want to reload a kanban:

Python code:

return {'type': 'ir.actions.act_close_wizard_and_reload_view', } 

Javascript code: (taken from the forum, i think for version 7)

openerp.bmwe_crm = function(instance, local) {
        instance.web.ActionManager = instance.web.ActionManager.extend({
                    ir_actions_act_close_wizard_and_reload_view: function (action, options) { 
                            if (!this.dialog) {
                                    options.on_close();
                            }
                            this.dialog_stop();
                            this.inner_widget.views[this.inner_widget.active_view].controller.reload();
                            return $.when();
                }
        });
}
 

All this from a forum about 7.0 version, but i am using 8.0 and it does not seems to work. I've even trying executing a default action:

return { 'type': 'ir.actions.client', 'tag': 'reload'} 

Does not reload the page neither

Avatar
Discard
Best Answer

Hello

please try this 

in wizard

return on your method

# your method 

return self.return_action()

def return_action(self):

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

data_id = model_obj._get_id('module', 'knaban view id')

view_id = model_obj.browse(data_id).res_id

return {

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

'tag': 'reload',

'name': _('Locker'),

'res_model': 'your model',

'view_type': 'kanban',

'view_mode': 'kanban',

'view_id': view_id,

'target': 'current',

'nodestroy': True,

}

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 23
6141
3
Sep 15
5341
0
Mar 15
2799
0
Mar 15
2888
1
Mar 15
4333