[MERGE] form trunk-bug-1059320-psa for FIX bug/1059320. Improved code for the displaying the db_list, if more than one db in list display name instead of debug

bzr revid: chm@openerp.com-20121127135621-kmnb4o2kv21bsmwz
This commit is contained in:
Christophe Matthieu 2012-11-27 14:56:21 +01:00
commit ebf4ae991a
1 changed files with 8 additions and 0 deletions

View File

@ -989,6 +989,14 @@ 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);
});
}
var avatar_src = self.session.url('/web/binary/image', {model:'res.users', field: 'image_small', id: self.session.uid});
$avatar.attr('src', avatar_src);
});