From 27511c5a3b36de3a727b3bfa62f1b2cbeb09da2f Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Wed, 25 Apr 2012 23:19:12 +0200 Subject: [PATCH] [FIX] honor homepage, dirty hack to avoid -u board on production databases bzr revid: al@openerp.com-20120425211912-ifm29hto7d7vdyle --- addons/web/static/src/js/chrome.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 902b002fa08..8fdb7cf9bbc 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1141,11 +1141,21 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC } else { var ds = new openerp.web.DataSetSearch(this, 'res.users'); ds.read_ids([this.session.uid], ['action_id']).then(function (users) { + var default_home = {type: 'ir.actions.client', tag: 'default_home'}; var home_action = users[0].action_id; if (!home_action) { - self.action_manager.do_action({type: 'ir.actions.client', tag: 'default_home'}); + self.action_manager.do_action(default_home); } else { - self.action_manager.do_action(home_action[0]); + // FIXME Dirty hack to avoid -u board, dont merge in 7 + var domain = [['model','=','ir.actions.act_window'],['res_id','=',home_action[0]]]; + var imd = new openerp.web.DataSetSearch(this, 'ir.model.data', {}, domain); + imd.read_slice(['name']).then(function (r) { + if(r.length && r[0].name === "board_homepage_action") { + self.action_manager.do_action(default_home); + } else { + self.action_manager.do_action(home_action[0]); + } + }) } }); }