Odoo Help

3

How to refresh the main window from wizard through button action?

By
Jasad
on 11/6/13, 8:45 AM 4,431 views

Consider there is a form view say sale order. In sale order , there is a button which is not in its header...call button A. When button A clicks, it pop ups the wizard, wizard consists of a button say B. B having some functionality to update in the master or source record ie, in sale order. So when B clicks, it executes the function and wizard gets closed.

So my requirement is button B should not close the wizard after executing the function and source/ master record gets refreshed(source record: sale order form) in the button action itself.

2
Petar
On 12/22/13, 5:53 AM

Hi Jasad,

As far as I know there is no such functionality in the framework at the moment. However, you can try with the following ActionManager extension which should be defined in the JS file within your module

Here for example: 'static/src/js/your_module_name.js'

openerp.your_module_name = function (instance) {
    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();
        },
    });
}

To use this action just return following when closing a wizard:

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

I hope this helps :-)

Cheers, Petar

Thanks Man. That Helped.. :)

Subhin P V
on 1/20/14, 5:28 AM

This action close works for ir.actions.act_window but not work for ir.actions.client? How to close the ir.actions.client to close? Thanks in advance.

Atchuthan - Technical Consultant, Sodexis Inc
on 6/11/14, 3:36 AM
0
sayed fathy
On 11/25/13, 11:00 AM

use this

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

Hi Sayed, This will reload the entire application. I dont want to do so. Just refreshing the main window.

Jasad
on 11/26/13, 5:16 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 11/6/13, 8:45 AM
Seen: 4431 times
Last updated: 9/17/15, 12:41 PM