diff options
Diffstat (limited to 'addons/web/static/src/js/chrome')
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager_act_window.js | 10 |
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); + }); }); }, /** |
