[FIX] problem with wizards
authorniv-openerp <nicolas.vanhoren@openerp.com>
Mon, 23 Jul 2012 13:49:14 +0000 (15:49 +0200)
committerniv-openerp <nicolas.vanhoren@openerp.com>
Mon, 23 Jul 2012 13:49:14 +0000 (15:49 +0200)
bzr revid: nicolas.vanhoren@openerp.com-20120723134914-4rrmeysncsancwfq

addons/web/static/src/js/chrome.js
addons/web/static/src/js/view_form.js

index 40cff06..38bcfef 100644 (file)
@@ -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');
         }
index d6ed85f..b75d088 100644 (file)
@@ -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}),