[FIX] web: force company_logo change on company change
authorDenis Ledoux <dle@odoo.com>
Thu, 27 Nov 2014 14:19:39 +0000 (15:19 +0100)
committerDenis Ledoux <dle@odoo.com>
Thu, 27 Nov 2014 14:21:25 +0000 (15:21 +0100)
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.

addons/web/controllers/main.py
addons/web/static/src/js/chrome.js

index e2c3d30..1cea529 100644 (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")
index bbf3615..a9a458c 100644 (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);
     },