summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2019-03-05 13:55:11 +0000
committerMartin Geubelle <mge@odoo.com>2019-03-06 10:28:01 +0000
commit1793d6d1383d17fa52f0739309e595bfdf5a278e (patch)
tree5ad91bc5c623f411fd7f4bf1bc6a9a3b4ed9f15d /addons/web/static/src/js
parent5805c032a4c8d388df2909715aac5eef8f464944 (diff)
[FIX] web: update breadcrumbs when switching view
To reproduce: 1. go on list view 2. open record in form view 3. come back on list view 4. switch to kanban 5. open record in form view 6. click on breadcrumb Before this rev. we were back on the list view, and not the kanban view. This is due to the fact that the breadcrumb was not updated when switching view, (if a controller was already existing) so the form view control panel breadcrumb was still referencing the wrong (list) controller. This bug appeared with the control panel refactoring, which is now managed by the view itself (and not the action manager as previously). Task 1932646 closes odoo/odoo#31598 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/chrome/action_manager_act_window.js3
-rw-r--r--addons/web/static/src/js/views/abstract_controller.js7
2 files changed, 8 insertions, 2 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 106f9f2aa47..d36ec9371de 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
@@ -535,6 +535,9 @@ ActionManager.include({
return newController(controller.jsID);
} else {
return $.when(controller.widget.willRestore()).then(function () {
+ viewOptions = _.extend({}, viewOptions, {
+ breadcrumbs: self._getBreadcrumbs(self.controllerStack.slice(0, index)),
+ });
return controller.widget.reload(viewOptions).then(function () {
return controller;
});
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js
index 77584a272d6..ae23d196cf9 100644
--- a/addons/web/static/src/js/views/abstract_controller.js
+++ b/addons/web/static/src/js/views/abstract_controller.js
@@ -243,7 +243,7 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
return;
}
self.renderer.setLocalState(localState);
- return self._update(state);
+ return self._update(state, params);
});
});
},
@@ -399,12 +399,15 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
*
* @private
* @param {Object} state the state given by the model
+ * @param {Object} [params]
+ * @param {Object[]} [params.breadcrumbs]
* @returns {Deferred}
*/
- _update: function () {
+ _update: function (state, params) {
// AAB: update the control panel -> this will be moved elsewhere at some point
var cpContent = _.extend({}, this.controlPanelElements);
this.updateControlPanel({
+ breadcrumbs: params && params.breadcrumbs,
cp_content: cpContent,
title: this.getTitle(),
});