[FIX] web: force company_logo change on company change

In multi company environment, the company logo was not updated on company change in the user preferences
This disrupted the end user, as he might think the company change did not happen.
This commit is contained in:
Denis Ledoux 2014-11-27 15:19:39 +01:00
parent c854404a2c
commit 62bc63e44f
2 changed files with 3 additions and 1 deletions

View File

@ -773,6 +773,7 @@ class Session(http.Controller):
"user_context": request.session.get_context() if request.session.uid else {},
"db": request.session.db,
"username": request.session.login,
"company_id": request.env.user.company_id.id if request.session.uid else None,
}
@http.route('/web/session/get_session_info', type='json', auth="none")

View File

@ -1292,7 +1292,8 @@ instance.web.WebClient = instance.web.Client.extend({
}
},
update_logo: function() {
var img = this.session.url('/web/binary/company_logo');
var company = this.session.company_id;
var img = this.session.url('/web/binary/company_logo' + (company ? '?company=' + company : ''));
this.$('.oe_logo img').attr('src', '').attr('src', img);
this.$('.oe_logo_edit').toggleClass('oe_logo_edit_admin', this.session.uid === 1);
},