[FIX] mail: add filter to see messages where user is mentioned
We add the filter during the instantiation of the search view by the "Discuss" client action because we can't access the partner_id in the xml filter definition.
This commit is contained in:
@@ -17,6 +17,7 @@ var Model = require('web.Model');
|
||||
|
||||
var pyeval = require('web.pyeval');
|
||||
var SearchView = require('web.SearchView');
|
||||
var session = require('web.session');
|
||||
var Widget = require('web.Widget');
|
||||
|
||||
var QWeb = core.qweb;
|
||||
@@ -196,7 +197,17 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
|
||||
'channel_inbox';
|
||||
var default_channel = chat_manager.get_channel(default_channel_id) ||
|
||||
chat_manager.get_channel('channel_inbox');
|
||||
|
||||
var mention_filter = {
|
||||
tag: 'filter',
|
||||
children: [],
|
||||
attrs:{
|
||||
name: 'mentions',
|
||||
string: _t('Has Mentions'),
|
||||
domain: "[('partner_ids', 'in', " + session.partner_id + ")]"
|
||||
}
|
||||
};
|
||||
this.fields_view = $.extend(true, {}, this.fields_view);
|
||||
this.fields_view.arch.children.push(mention_filter);
|
||||
this.searchview = new SearchView(this, this.dataset, this.fields_view, options);
|
||||
this.searchview.on('search_data', this, this.on_search);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user