[FIX] problem with wizards

bzr revid: nicolas.vanhoren@openerp.com-20120723134914-4rrmeysncsancwfq
This commit is contained in:
niv-openerp 2012-07-23 15:49:14 +02:00
parent c53deab987
commit 071dce2cb9
2 changed files with 10 additions and 5 deletions

View 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');
}

View 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}),