From 071dce2cb94536c408b94f57967d223f94eb776c Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 23 Jul 2012 15:49:14 +0200 Subject: [PATCH] [FIX] problem with wizards bzr revid: nicolas.vanhoren@openerp.com-20120723134914-4rrmeysncsancwfq --- addons/web/static/src/js/chrome.js | 9 +++++++++ addons/web/static/src/js/view_form.js | 6 +----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 40cff06e66a..38bcfef3e05 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -135,8 +135,12 @@ instance.web.Dialog = instance.web.Widget.extend({ this.$element.dialog('close'); }, on_close: function() { + if (this.__tmp_dialog_destroying) + return; if (this.dialog_options.destroy_on_close) { + this.__tmp_dialog_closing = true; this.destroy(); + this.__tmp_dialog_closing = undefined; } }, on_resized: function() { @@ -145,6 +149,11 @@ instance.web.Dialog = instance.web.Widget.extend({ _.each(this.getChildren(), function(el) { el.destroy(); }); + if (! this.__tmp_dialog_closing) { + this.__tmp_dialog_destroying = true; + this.close(); + this.__tmp_dialog_destroying = undefined; + } if (! this.isDestroyed()) { this.$element.dialog('destroy'); } diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d6ed85fedad..b75d0886387 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1682,11 +1682,7 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ on_confirmed: function() { var self = this; - var context = this.node.attrs.context; - if (context && context.__ref) { - context = new instance.web.CompoundContext(context); - context.set_eval_context(this._build_eval_context()); - } + var context = this.build_context(); return this.view.do_execute_action( _.extend({}, this.node.attrs, {context: context}),