[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
This commit is contained in:
Denis Ledoux
2015-12-24 14:13:17 +01:00
parent 4f1bfdf640
commit cccec4ac62
+5 -4
View File
@@ -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
},