summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/action_manager.js
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2018-06-11 12:08:19 +0200
committerLucas Perais (lpe) <lpe@odoo.com>2018-06-21 13:13:36 +0200
commitf0efcbe592319fdcb14e2342a14257580ed2f45d (patch)
treea3f2ecaa0d3cc90837048e58cf07f7470fd381e8 /addons/web/static/src/js/chrome/action_manager.js
parent226230952a9c42a79492002749d81a9ca3cae51f (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/chrome/action_manager.js')
-rw-r--r--addons/web/static/src/js/chrome/action_manager.js5
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;