From 8bb4d9df688c4e97e0f83cbe136685e8aee36c3c Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 8 Sep 2016 16:15:30 +0200 Subject: [PATCH 1/2] [FIX] web: traceback when click on 'Edit Company data' button Try to bind event without wait the action deferred --- addons/web/static/src/js/web_client.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/web/static/src/js/web_client.js b/addons/web/static/src/js/web_client.js index 4ec80b60cc9..081ec244b99 100644 --- a/addons/web/static/src/js/web_client.js +++ b/addons/web/static/src/js/web_client.js @@ -77,12 +77,13 @@ return AbstractWebClient.extend({ action_buttons: true, headless: true, }; - self.action_manager.do_action(result); - var form = self.action_manager.dialog_widget.views.form.controller; - form.on("on_button_cancel", self.action_manager, self.action_manager.dialog_stop); - form.on('record_saved', self, function() { - self.action_manager.dialog_stop(); - self.update_logo(); + self.action_manager.do_action(result).then(function () { + var form = self.action_manager.dialog_widget.views.form.controller; + form.on("on_button_cancel", self.action_manager, self.action_manager.dialog_stop); + form.on('record_saved', self, function() { + self.action_manager.dialog_stop(); + self.update_logo(); + }); }); }); }); From 2adcf523cfe6fff88c62df017880ca8c3b321c15 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 8 Sep 2016 16:17:04 +0200 Subject: [PATCH 2/2] [FIX] web: company image not update when use 'Edit Company data' button Wrong class selector and must add '#' to force the browser to reload the picture because the picture is in the cache with the previous cache informations. --- addons/web/static/src/js/web_client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/web_client.js b/addons/web/static/src/js/web_client.js index 081ec244b99..4a9ce5e11ff 100644 --- a/addons/web/static/src/js/web_client.js +++ b/addons/web/static/src/js/web_client.js @@ -59,10 +59,10 @@ return AbstractWebClient.extend({ toggle_bars: function(value) { this.$('tr:has(td.navbar),.oe_leftbar').toggle(value); }, - update_logo: function() { + update_logo: function(reload) { var company = session.company_id; var img = session.url('/web/binary/company_logo' + '?db=' + session.db + (company ? '&company=' + company : '')); - this.$('.oe_logo img').attr('src', '').attr('src', img); + this.$('.o_sub_menu_logo img').attr('src', '').attr('src', img + (reload ? "#" + Date.now() : '')); this.$('.oe_logo_edit').toggleClass('oe_logo_edit_admin', session.uid === 1); }, logo_edit: function(ev) {