summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/web_client.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-03-19 14:18:55 +0100
committerAlexandre Kühn <aku@odoo.com>2018-03-19 15:17:56 +0100
commit71616e8d4f9a5bf92487dc6cc89d4945d29b4343 (patch)
treeddd27ccfc4e8b6f3aed7436210c44c6b7e5f55fc /addons/web/static/src/js/chrome/web_client.js
parente2dd31cd7bb51f3908c8737f6d474312afa948f4 (diff)
[FIX] web: pick correct menu item on hashchange
Before this commit, we had the following issue: 1. install CRM and Sales 2. Sales > Customers > (open any form) 3. Click on browser's "back" button We are redirected to the contact kanban view in CRM instead of Sales. This is due to the fact that both menu items share the same action. When the user uses the browser's "back" button (AKA. it triggers an hashchange event), the web_client opens the first menu_item that matches the action. This commit fixes the issue by allowing us to open an action by providing a menu ID: 1. If it matches the action, then it opens this menu instead of the first match. 2. If we do not provide any menuID, or this menuID does not match with the action, it falls back to the first menu matching this action. Fixes #23639
Diffstat (limited to 'addons/web/static/src/js/chrome/web_client.js')
-rw-r--r--addons/web/static/src/js/chrome/web_client.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/web_client.js b/addons/web/static/src/js/chrome/web_client.js
index ebbc0bb3143..dbdaedfddf2 100644
--- a/addons/web/static/src/js/chrome/web_client.js
+++ b/addons/web/static/src/js/chrome/web_client.js
@@ -139,7 +139,7 @@ return AbstractWebClient.extend({
self.action_manager.do_load_state(state, !!self._current_state).then(function () {
var action = self.action_manager.get_inner_action();
if (action) {
- self.menu.open_action(action.action_descr.id);
+ self.menu.open_action(action.action_descr.id, state.menu_id);
}
});
}