summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2016-10-12 22:15:22 +0200
committerSimon Lejeune <sle@openerp.com>2016-10-13 14:38:33 +0200
commita7b976c70455e9bb48f827cd45f3c1dc4887fac7 (patch)
tree0d36da8ddbf0d1d549e6aee36c3d666a32da0aec /addons/web/static/src
parent89700eb7713389d05caafbbace9b109e6c868e11 (diff)
[FIX] web: browser's back button while in the same action
When you browse through the views of an action and then hit the back button, the view does not change. For example, go to the customers kanban, click on a customer, hit back, you're still in the customer form view. related rev: 46857d267b46c6ae91817231f8293403117bb75e `do_load_state` is called when you hit f5 or press the back button on your browser. The related rev took care of fixing the ugly part that make the webclient goes trough the multi record view then the mono record view when you hit f5 on a mono record view. In this context, it removed the code in view manager's `do_load_state` that switched the mode of the action if it isn't the same the one the web client is trying to restore from the state (because now the correct mode is loaded). However, if you hit the back button while the previous view is in the same action, it obviously doesn't switch the mode anymore and you're facing the same view. The issue is fixed by restoring the switch_mode in the view manager's `do_load_state` (without its oudated comment).
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_manager.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/view_manager.js b/addons/web/static/src/js/view_manager.js
index 6a8a162e144..ec7ce95313a 100644
--- a/addons/web/static/src/js/view_manager.js
+++ b/addons/web/static/src/js/view_manager.js
@@ -458,6 +458,9 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
}
},
do_load_state: function(state, warm) {
+ if (state.view_type && state.view_type !== this.active_view.type) {
+ this.switch_mode(state.view_type, true);
+ }
this.active_view.controller.do_load_state(state, warm);
},
});