summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2018-09-27 11:43:29 +0200
committerMartin Geubelle <mge@odoo.com>2018-09-27 12:34:04 +0200
commitf4b2060af51f8e1d896711be55f7bee8c6d1bb75 (patch)
treed72cfe9ff483418de56f673f070500f195ba9916 /addons/web/static/src/js
parentcf50388d1016908e537231a78adb041af897aabb (diff)
[FIX] web: handle lazy load with previous actions
Before this rev. the lazy loading of views was correctly handled if there was only one action in the action stack (which is usually the case when performing a F5, the main use case of the view lazy loading). Nevertheless, it might happen that the lazy-loading is used in top of other actions (when performing a `doAction` with a form view for an action with another view as first view, i.e. when leaving Studio while editing the form view). The controller was `unshift` in the case (put in the first position of the controller stack), which is not correct. This causes the breadcrumb to be misordered and a traceback occured when trying to access a breadcrumb element. Co-authored-by: Aaron Bohy <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/chrome/action_manager_act_window.js4
1 files changed, 3 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 eee8ffc9e92..c41123828f4 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
@@ -340,7 +340,9 @@ ActionManager.include({
action.controllerID = controller.jsID;
return self._executeAction(action, options).done(function () {
if (lazyLoadedController) {
- self.controllerStack.unshift(lazyLoadedController.jsID);
+ // controller should be placed just before the current one
+ var index = self.controllerStack.length - 1;
+ self.controllerStack.splice(index, 0, lazyLoadedController.jsID);
self.controlPanel.update({
breadcrumbs: self._getBreadcrumbs(),
}, {clear: false});