summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-07-29 14:10:30 +0200
committerChristophe Simonis <chs@odoo.com>2019-07-29 14:10:30 +0200
commitd5e1fd16b4fd796cc25b2b2d694dadb375110ce7 (patch)
tree35d130b4161985cd9ca3071a59980b52e8401be5 /addons/web/static/src/js/chrome
parentae71f95371b4a5c99c10a23e3553c5badc45a1ac (diff)
parentcda4f3c308ca233aead81f5ae97d250b5b7bf82f (diff)
[MERGE] forward port branch saas-12.4 up to cda4f3c308c
Diffstat (limited to 'addons/web/static/src/js/chrome')
-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 ef9273bb484..1a08bf59a9a 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);
+ });
});
},
/**