[FIX] fetching of the user's home action when not logge in

bzr revid: xmo@openerp.com-20110726150403-cwmw2a14g8gzjwbk
This commit is contained in:
Xavier Morel
2011-07-26 17:04:03 +02:00
parent 68e2f58e43
commit 59d1f3dc4e
+5 -3
View File
@@ -920,18 +920,20 @@ openerp.base.WebClient = openerp.base.Controller.extend({
load_url_state: function () {
var self = this;
// TODO: add actual loading if there is url state to unpack, test on window.location.hash
// not logged in
if (!this.session.uid) { return; }
var ds = new openerp.base.DataSetSearch(this, 'res.users');
ds.read_ids([parseInt(this.session.uid, 10)], ['action_id'], function (users) {
ds.read_ids([this.session.uid], ['action_id'], function (users) {
var home_action = users[0].action_id;
if (!home_action) {
self.default_home();
return;
}
// oh dear
self.execute_home_action(home_action[0], ds);
})
},
default_home: function () { console.log('base default home') },
default_home: function () { },
/**
* Bundles the execution of the home action
*