summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core/dialog.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2019-07-04 13:34:51 +0000
committerAaron Bohy <aab@odoo.com>2019-07-09 07:59:05 +0000
commitea2207afeab8c4d8da6b010aebd99f896e04359b (patch)
treed0911418ee1e59c673750ae68896f660a255949d /addons/web/static/src/js/core/dialog.js
parent9cab694bf594f6c7c8d795174d9159ac82f526b2 (diff)
[FIX] web: don't close dialog on doAction with target 'new'
Rev. ee44d23 fixed a usability issue: when a doAction is performed from a dialog, it automatically closes the dialog (as the action is rendered in the background, behind the dialog). However, it also closes dialogs when the action has target='new', i.e. when it also opens in a dialog, which is not strictly necessary in this case. This is problematic in mobile for the product configurator widget: in the sale.order form view, the order_line field is displayed as a kanban, and in its form view, the product_(template_)id field has widget product_configurator. When a value is set, it performs a doAction (target="new") to configure the product. The widget listens to the dialog's 'closed' event to update itself. However, with what is done in ee44d23, the x2many form dialog is closed by the DoAction, so the flow doesn't work. This rev. reverts the attempt done in ee44d23, and does something a bit more brutal: as soon as an action is pushed in target 'current' (in the main part of the interface), all dialogs are automatically closed. closes odoo/odoo#34678 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/core/dialog.js')
-rw-r--r--addons/web/static/src/js/core/dialog.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js
index 8f128b657d9..e3101e52bde 100644
--- a/addons/web/static/src/js/core/dialog.js
+++ b/addons/web/static/src/js/core/dialog.js
@@ -22,8 +22,8 @@ var Dialog = Widget.extend({
custom_events: _.extend({}, Widget.prototype.custom_events, {
focus_control_button: '_onFocusControlButton',
}),
- events: _.extend({} , Widget.prototype.events, {
- 'keydown .modal-footer button':'_onFooterButtonKeyDown',
+ events: _.extend({}, Widget.prototype.events, {
+ 'keydown .modal-footer button': '_onFooterButtonKeyDown',
}),
/**
* @param {Widget} parent
@@ -92,6 +92,8 @@ var Dialog = Widget.extend({
this.backdrop = options.backdrop;
this.renderHeader = options.renderHeader;
this.renderFooter = options.renderFooter;
+
+ core.bus.on('close_dialogs', this, this.destroy.bind(this));
},
/**
* Wait for XML dependencies and instantiate the modal structure (except