summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core/dialog.js
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2020-01-10 12:17:50 +0000
committerJulien Mougenot <jum@odoo.com>2020-01-10 12:48:41 +0000
commit1d58b760326712bd9d778b196829149896a0882e (patch)
tree46f590ec154f1bf8edd684ffc14d495976d5739a /addons/web/static/src/js/core/dialog.js
parent2f3e6e9ea8e8f747f7f5f9210ddc6d147863f40f (diff)
[FIX] web: correctly handle display/hide of dialogs
Before this commit: all dialogs would go through the static method (OwlDialog.hide) when destroyed, regardless of wether they had been opened or not. Now, only dialogs having an 'el' property set (= having been opened) will use the 'hide' method. Task 2170705 closes odoo/odoo#43124 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/core/dialog.js')
-rw-r--r--addons/web/static/src/js/core/dialog.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js
index 6e9620421c3..eb567750584 100644
--- a/addons/web/static/src/js/core/dialog.js
+++ b/addons/web/static/src/js/core/dialog.js
@@ -240,8 +240,11 @@ var Dialog = Widget.extend({
return;
}
- // Notifies OwlDialog to adjust focus/active properties on owl dialogs
- OwlDialog.hide(this);
+ // Notifies OwlDialog to adjust focus/active properties on owl dialogs.
+ // Only has to be done if the dialog has been opened (has an el).
+ if (this.el) {
+ OwlDialog.hide(this);
+ }
// Triggers the onForceClose event if the callback is defined
if (this.onForceClose) {