summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/action_manager_act_window.js
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-07-24 07:36:59 +0000
committerMartin Trigaux <mat@odoo.com>2019-07-24 10:32:23 +0000
commita98427834e00380e2e63e08668f5c2b069e3c2ea (patch)
treefbefd4a26124efbaf5e6b4bdbf58ec570014c896 /addons/web/static/src/js/chrome/action_manager_act_window.js
parent4e6ee3ac97041653ff15a77abd77084dc0c9f525 (diff)
parent860ab5a1c28ba85d7a193d68cfbbb1063bbf0651 (diff)
[MERGE] Forward port of saas-12.2 to saas-12.3 up to 860ab5a1c28ba
closes odoo/odoo#35119 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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 28c7d96b5d8..ec5661aa0a7 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);
+ });
});
},
/**