[FIX] exception when logging in the web client and the server was launched using --no-database-list

lp bug: https://launchpad.net/bugs/1094179 fixed

bzr revid: nicolas.vanhoren@openerp.com-20130103141945-11afh6khtpa7tapm
This commit is contained in:
niv-openerp 2013-01-03 15:19:45 +01:00
parent 8c2999d35c
commit 5469b4709b
1 changed files with 2 additions and 7 deletions

View File

@ -1033,13 +1033,8 @@ instance.web.UserMenu = instance.web.Widget.extend({
if(res.company_id[0] > 1)
topbar_name = _.str.sprintf("%s (%s)", topbar_name, res.company_id[1]);
self.$el.find('.oe_topbar_name').text(topbar_name);
if(!instance.session.debug) {
self.rpc("/web/database/get_list", {}).done( function(result) {
if (result.length > 1) {
topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.session.db);
}
self.$el.find('.oe_topbar_name').text(topbar_name);
});
if (!instance.session.debug) {
topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.session.db);
}
var avatar_src = self.session.url('/web/binary/image', {model:'res.users', field: 'image_small', id: self.session.uid});
$avatar.attr('src', avatar_src);