From cccec4ac623a6d612a9395fc412a89e1f2b67eb4 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 24 Dec 2015 14:09:14 +0100 Subject: [PATCH] [FIX] mail: To: me, To-do display messages `to_read` These menus are supposed to display the message to: me / to do that matches the `To Read` filter. The filter was correctly displayed in the search view, but the records displayed were not the result of the search, because the call to `message_read`, in `message_fetch` was done too early, with the wrong domain. This is because `searchview.has_defaults` & `searchview.ready` have disapeared in saas-6, with the refactoring of the search view. opw-659137 --- addons/mail/static/src/js/mail.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index ef286097dc9..bc1fffb6b03 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1967,7 +1967,7 @@ openerp.mail = function (session) { this._super.apply(this); this.bind_events(); var searchview_loaded = this.load_searchview(this.defaults); - if (! this.searchview.has_defaults) { + if (_.isEmpty(this.searchview.defaults)) { this.message_render(); } // render sidebar @@ -1990,10 +1990,11 @@ openerp.mail = function (session) { this.searchview.on('search_data', this, this.do_searchview_search); this.searchview.appendTo(this.$('.oe-view-manager-search-view')).then(function () { self.searchview.toggle_visibility(true); + if (!_.isEmpty(self.searchview.defaults)) { + self.searchview.do_search(); + } }); - if (this.searchview.has_defaults) { - this.searchview.ready.then(this.searchview.do_search); - } + return this.searchview },