diff options
| author | Aaron Bohy <aab@odoo.com> | 2021-02-17 09:27:48 +0000 |
|---|---|---|
| committer | Jorge Pinna Puissant <jpp@odoo.com> | 2021-02-17 12:06:00 +0000 |
| commit | 98f9cb4f692a15494cd8ef298673fe1c949c423c (patch) | |
| tree | 26120f0c69b5c6b376133232e24cf1f823c76a65 /addons/web/static/src/js/views | |
| parent | e695cb7c7d6eb989fd0540412d137410363a483f (diff) | |
[FIX] web: correctly close confirm dialog
Let's assume the following scenario:
- have an action in target new (e.g. a form view)
- in the dialog, have an action/object button with confirm
attribute
- when clicking on that button, a confirm dialog opens
- if validated, the following action returned by the server
is again an action in target new
Before this commit, the confirm dialog remained in the DOM.
This issue occurred because it's parent wasn't correctly set (wrong
use of `this`), so when the first dialog was destroyed, the confirm
dialog wasn't automatically destroyed in turn.
OPW~2440712
closes odoo/odoo#66345
X-original-commit: 2016fe31af970976775c9df160a31abfbec742ba
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/form/form_controller.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/form/form_controller.js b/addons/web/static/src/js/views/form/form_controller.js index 0f38649d0bc..c203d0ed0b5 100644 --- a/addons/web/static/src/js/views/form/form_controller.js +++ b/addons/web/static/src/js/views/form/form_controller.js @@ -468,7 +468,7 @@ var FormController = BasicController.extend({ var attrs = ev.data.attrs; if (attrs.confirm) { def = new Promise(function (resolve, reject) { - Dialog.confirm(this, attrs.confirm, { + Dialog.confirm(self, attrs.confirm, { confirm_callback: saveAndExecuteAction, }).on("closed", null, resolve); }); |
