Merge lp:~openerp-dev/openerp-web/7.0-action-id-user-mat into lp:openerp-web/7.0

Proposed by Martin Trigaux (OpenERP)
Status: Merged
Merged at revision: 4142
Proposed branch: lp:~openerp-dev/openerp-web/7.0-action-id-user-mat
Merge into: lp:openerp-web/7.0
Diff against target: 26 lines (+10/-4)
1 file modified
addons/web/static/src/js/chrome.js (+10/-4)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-action-id-user-mat
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+206427@code.launchpad.net

Description of the change

Fixing the broken field 'action_id' on res.users when going 6.1 -> 7

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/chrome.js'
2--- addons/web/static/src/js/chrome.js 2014-01-07 16:11:54 +0000
3+++ addons/web/static/src/js/chrome.js 2014-02-14 11:27:21 +0000
4@@ -1407,12 +1407,18 @@
5 $(window).bind('hashchange', this.on_hashchange);
6
7 var state = $.bbq.getState(true);
8+
9 if (_.isEmpty(state) || state.action == "login") {
10 self.menu.has_been_loaded.done(function() {
11- var first_menu_id = self.menu.$el.find("a:first").data("menu");
12- if(first_menu_id) {
13- self.menu.menu_click(first_menu_id);
14- }
15+ new instance.web.Model("res.users").call("read", [self.session.uid, ["action_id"]]).done(function(data) {
16+ var first_menu_id = self.menu.$el.find("a:first").data("menu");
17+ if(first_menu_id)
18+ self.menu.menu_click(first_menu_id);
19+
20+ if(data.action_id) {
21+ self.action_manager.do_action(data.action_id[0]);
22+ }
23+ });
24 });
25 } else {
26 $(window).trigger('hashchange');