From 57b48602fb7afa5d0539e8d0caa8d1e10c3910e5 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 2 Sep 2014 17:32:37 +0200 Subject: [PATCH] [FIX] web: chain close action on wizard confirm If a wizard has several steps, or laucnh a second wizard, the view from where has been loaded the initial wizard is finally reloaded --- addons/web/static/src/js/views.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 78accfd4da4..b59e86b2192 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -373,6 +373,10 @@ instance.web.ActionManager = instance.web.Widget.extend({ } var widget = executor.widget(); if (executor.action.target === 'new') { + var pre_dialog = this.dialog; + if (pre_dialog){ + pre_dialog.off('closing', null, pre_dialog.on_close); + } if (this.dialog_widget && !this.dialog_widget.isDestroyed()) { this.dialog_widget.destroy(); } @@ -380,7 +384,13 @@ instance.web.ActionManager = instance.web.Widget.extend({ this.dialog = new instance.web.Dialog(this, { dialogClass: executor.klass, }); - this.dialog.on("closing", null, options.on_close); + this.dialog.on_close = function(){ + options.on_close.apply(null, arguments); + if (pre_dialog && pre_dialog.on_close){ + pre_dialog.on_close(); + } + }; + this.dialog.on("closing", null, this.dialog.on_close); this.dialog.dialog_title = executor.action.name; if (widget instanceof instance.web.ViewManager) { _.extend(widget.flags, {