From 305bc218fe6829350d041aff3e70151dc2fd4ebe Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 24 Apr 2012 00:26:54 +0200 Subject: [PATCH] [FIX] honor homeaction bzr revid: al@openerp.com-20120423222654-jptmusgokeu9bdz7 --- addons/web/static/src/js/chrome.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 6636d5ab73e..902b002fa08 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1133,13 +1133,21 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC }); }, bind_hashchange: function() { + var self = this; $(window).bind('hashchange', this.on_hashchange); - var state = $.bbq.getState(true); if (! _.isEmpty(state)) { $(window).trigger('hashchange'); } else { - this.action_manager.do_action({type: 'ir.actions.client', tag: 'default_home'}); + var ds = new openerp.web.DataSetSearch(this, 'res.users'); + ds.read_ids([this.session.uid], ['action_id']).then(function (users) { + var home_action = users[0].action_id; + if (!home_action) { + self.action_manager.do_action({type: 'ir.actions.client', tag: 'default_home'}); + } else { + self.action_manager.do_action(home_action[0]); + } + }); } }, on_hashchange: function(event) {