diff options
| author | Julien Giannone <jgi@odoo.com> | 2020-10-07 14:01:14 +0000 |
|---|---|---|
| committer | Julien Giannone <jgi@odoo.com> | 2020-11-23 07:39:26 +0000 |
| commit | 884bebb0f549dc4385cec9542f74e0bba64ccb08 (patch) | |
| tree | d972bce16bbf7a255be0a963974294bb048b9cad /addons/mail/static/src/models | |
| parent | 87ea687169c9a0047b41b11ab143544142c82aae (diff) | |
[FIX] mail: Sidebar channel find shows all channels
When searching for a channel in Discuss, the search results include
all matching channels even those user is already member of
task-2347837
closes odoo/odoo#60063
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models')
| -rw-r--r-- | addons/mail/static/src/models/discuss/discuss.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/addons/mail/static/src/models/discuss/discuss.js b/addons/mail/static/src/models/discuss/discuss.js index 5fe14196602..513b77fd5db 100644 --- a/addons/mail/static/src/models/discuss/discuss.js +++ b/addons/mail/static/src/models/discuss/discuss.js @@ -79,10 +79,18 @@ function factory(dependencies) { const value = req.term; const escapedValue = owl.utils.escape(value); this.update({ addingChannelValue: value }); + const domain = [ + ['channel_type', '=', 'channel'], + ['name', 'ilike', value], + ]; + const fields = ['channel_type', 'name', 'public', 'uuid']; const result = await this.async(() => this.env.services.rpc({ - model: 'mail.channel', - method: 'channel_search_to_join', - args: [value], + model: "mail.channel", + method: "search_read", + kwargs: { + domain, + fields, + }, })); const items = result.map(data => { let escapedName = owl.utils.escape(data.name); |
