From e0ea7c04f96452e930b38d32e5bdff5e0c02de20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 19 Jan 2016 11:25:46 +0100 Subject: [PATCH] [FIX] mail: fix issue with disappearing filters in some cases The client action had a weird issue: going back from a breadcrumb to the client action made the searchview (filters/favorites) buttons disappear. This is caused by a weird behavior of the control panel. This fix is the safest for now, but working on the control panel behavior would be a better long term solution. --- addons/mail/static/src/js/client_action.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index 46190c1dd0b..38cc26e8997 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -214,7 +214,9 @@ var ChatAction = Widget.extend(ControlPanelMixin, { var def1 = this.thread.appendTo(this.$('.o_mail_chat_content')); var def2 = this.basic_composer.appendTo(this.$('.o_mail_chat_content')); var def3 = this.extended_composer.appendTo(this.$('.o_mail_chat_content')); - var def4 = this.searchview.appendTo($("
")); + var def4 = this.searchview.appendTo($("
")).then(function () { + self.$searchview_buttons = self.searchview.$buttons.contents(); + }); this.render_sidebar(); @@ -486,7 +488,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, { cp_content: { $buttons: this.$buttons, $searchview: this.searchview.$el, - $searchview_buttons: this.searchview.$buttons.contents(), + $searchview_buttons: this.$searchview_buttons, }, searchview: this.searchview, });