Odoo Help

Welcome!

This community 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.

3

How to refresh the original view after wizard actions? [Closed]

By
Hannes Smit
on 4/8/13, 8:22 AM 13,965 views

The Question has been closed

by
Sudhir Arya (SA)
on 12/23/2013 00:55:06

I built a wizard with multiple views on the same wizard class. After proceeding through all the steps, the users hits the last button.

The python code:

return {}

Then, the form view is not refreshed.

However, after the first step in the wizard, the original form view refreshes.

13
Turkesh Patel (tpa)
On 4/8/13, 9:54 AM

Use this:

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

Yes, that works, thanks! Do you perhaps know why this is needed?

Hannes Smit
on 4/8/13, 10:26 AM

when you will return nothing then it will it simply close that wizard and to reload you will need to pass this values.

Turkesh Patel (tpa)
on 4/8/13, 10:36 AM

@Turky: but it seems strange to me that it (the source form view) does refresh after the first 'click' (in the darker background). What triggers that then?

Hannes Smit
on 4/10/13, 5:17 AM

Thanks!! It's work!

Cpueyo
on 4/12/13, 6:42 AM

It's a pity that this reload the complete web application. Is there a way to trigger a refresh like 'button_dummy' that triggers the view to be refreshed from the DB ?

Apertoso, Jos De Graeve
on 4/24/13, 8:36 AM

i think there is only one moment the original view refresh and is when the wizard is saved that is when an ID is assigned, this happen when click on a button.

bruno bottacini
on 10/8/13, 6:36 AM

Does not work here (on 6.1). With new style wizard (TransientModel).

What version are you using? Old style wizards or osv_memory/TransientModel?

Ronald Portier
on 11/18/13, 1:30 PM
4
Petar
On 12/22/13, 5:56 AM

Hi Hannes,

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:27 AM

Great trick! Thanks

Pedro M. Baeza
on 4/4/14, 11:23 PM

@Hannes, Is it possible to create for ir.actions.clients_close that works for client window?

Atchuthan - Technical Consultant, Sodexis Inc
on 6/12/14, 2:09 AM

Awesome! Thanks.

Andre
on 8/13/15, 5:19 AM
0
Ronald Portier
On 11/18/13, 1:30 PM

Does not work here (on 6.1). With new style wizard (TransientModel).

What version are you using? Old style wizards or osv_memory/TransientModel?

I think this was in the context of v 7

Hannes Smit
on 6/17/14, 3:22 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)

Stats

Asked: 4/8/13, 8:22 AM
Seen: 13965 times
Last updated: 11/30/16, 1:17 AM