diff options
| author | Fabien Meghazi <fme@openerp.com> | 2012-11-15 16:10:46 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2012-11-15 16:10:46 +0100 |
| commit | 8a3d2c474483a79e1e4efbc067881a91d2f7a2bd (patch) | |
| tree | ffda03b0f5b99ef5dc849c7562ce899a088eca19 /addons/web/static/src/js | |
| parent | b7bb7e624639c7be098ecb19d09ab4d9a50f4af5 (diff) | |
[FIX] For act window target new, always use a new dialog object
Buttons footer hack in dialogs makes reusability of dialog impossible
bzr revid: fme@openerp.com-20121115151046-0r8xz85racjta7p3
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 6a0294c3d88..d804bd57cf8 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -25,6 +25,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ dialog_stop: function () { if (this.dialog) { this.dialog.destroy(); + this.dialog = null; } }, /** @@ -310,15 +311,15 @@ instance.web.ActionManager = instance.web.Widget.extend({ } var widget = executor.widget(); if (executor.action.target === 'new') { - if (this.dialog_widget && ! this.dialog_widget.isDestroyed()) + if (this.dialog_widget && !this.dialog_widget.isDestroyed()) { this.dialog_widget.destroy(); - if (this.dialog === null || this.dialog.isDestroyed()) { - this.dialog = new instance.web.Dialog(this, { - dialogClass: executor.klass, - }); - this.dialog.on("closing", null, options.on_close); - this.dialog.init_dialog(); } + this.dialog_stop(); + this.dialog = new instance.web.Dialog(this, { + dialogClass: executor.klass, + }); + this.dialog.on("closing", null, options.on_close); + this.dialog.init_dialog(); this.dialog.dialog_title = executor.action.name; if (widget instanceof instance.web.ViewManager) { _.extend(widget.flags, { |
