diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2018-06-11 12:08:19 +0200 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2018-06-21 13:13:36 +0200 |
| commit | f0efcbe592319fdcb14e2342a14257580ed2f45d (patch) | |
| tree | a3f2ecaa0d3cc90837048e58cf07f7470fd381e8 /addons/web/static/src/js | |
| parent | 226230952a9c42a79492002749d81a9ca3cae51f (diff) | |
[FIX] web: actions target=new should transmit their on_close
Have an action that opens a dialog, with a specific callback
to execute when the dialog closes
In the dialog, have a button linked to an action that opens
another dialog in target = new
Close this 2nd dialog
Before this commit, the callback was not executed
After this commit the callback is executed
OPW 1853136
closes #25180
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js index ecd1d89ea9c..97c68e2474d 100644 --- a/addons/web/static/src/js/chrome/action_manager.js +++ b/addons/web/static/src/js/chrome/action_manager.js @@ -388,10 +388,13 @@ var ActionManager = Widget.extend({ } return this._startController(controller).then(function (controller) { + var prevDialogOnClose; if (self.currentDialogController) { + prevDialogOnClose = self.currentDialogController.onClose; self._closeDialog(true); } + controller.onClose = prevDialogOnClose || options.on_close; var dialog = new Dialog(self, _.defaults({}, options, { buttons: [], dialogClass: controller.className, @@ -402,7 +405,7 @@ var ActionManager = Widget.extend({ self._removeAction(action.jsID); self.currentDialogController = null; if (silent !== true) { - options.on_close(); + controller.onClose(); } }); controller.dialog = dialog; |
