summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/action_manager_act_window.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-07-26 15:12:29 +0200
committerChristophe Simonis <chs@odoo.com>2019-07-26 15:12:29 +0200
commitbfd34e14b1be97465e135d85c76b9e626a219e7a (patch)
tree8de54ec8f504158e965ab92e21658cab539024ee /addons/web/static/src/js/chrome/action_manager_act_window.js
parent26b5b446b3dab3d66b7db054ca77e7b1a811c28a (diff)
parent40e8b67179f212551a176d72b3851671febc1fba (diff)
[MERGE] forward port branch saas-12.3 up to 40e8b67179f
Diffstat (limited to 'addons/web/static/src/js/chrome/action_manager_act_window.js')
-rw-r--r--addons/web/static/src/js/chrome/action_manager_act_window.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager_act_window.js b/addons/web/static/src/js/chrome/action_manager_act_window.js
index c19364fa7a9..325a8d1e11e 100644
--- a/addons/web/static/src/js/chrome/action_manager_act_window.js
+++ b/addons/web/static/src/js/chrome/action_manager_act_window.js
@@ -295,6 +295,7 @@ ActionManager.include({
}
var lazyViewDef;
+ var lazyControllerID;
if (lazyView) {
// if the main view is lazy-loaded, its (lazy-loaded) controller is inserted
// into the controller stack (so that breadcrumbs can be correctly computed),
@@ -304,6 +305,7 @@ ActionManager.include({
// this controller being lazy-loaded, this call is actually sync
lazyViewDef = self._createViewController(action, lazyView.type, {}, {lazy: true})
.then(function (lazyLoadedController) {
+ lazyControllerID = lazyLoadedController.jsID;
self.controllerStack.push(lazyLoadedController.jsID);
});
}
@@ -322,7 +324,13 @@ ActionManager.include({
action.controllerID = controller.jsID;
return self._executeAction(action, options);
})
- .guardedCatch(self._destroyWindowAction.bind(self, action));
+ .guardedCatch(function () {
+ if (lazyControllerID) {
+ var index = self.controllerStack.indexOf(lazyControllerID);
+ self.controllerStack = self.controllerStack.slice(0, index);
+ }
+ self._destroyWindowAction(action);
+ });
});
},
/**