diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-09-11 17:34:30 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-09-12 15:02:22 +0200 |
| commit | 611b42409e426f64948499d92a95f5621e053dce (patch) | |
| tree | 50648f2e313c938caf869b05b060861502030d1c /addons/mail/static/src/xml/thread.xml | |
| parent | 3b76886f9a3b64fa89acc4044d5a479711a01ad9 (diff) | |
[FIX] mail: filter messages in thread (Discuss)
Revision on https://github.com/odoo/odoo/commit/ec8c505bc1c9ec21939e9ffef53a9cc6f63f30c7
The commit above changes the way threads are rendered: the template
now uses a thread object, instead of a list of messages.
However, it was not handling messages that have been filtered from
the searchview. As a result, it was not possible to filter messages
at all.
This commit re-adds the possibility to filter messages, by providing
information on the domain of the thread in the template.
Task-ID 1877502
Diffstat (limited to 'addons/mail/static/src/xml/thread.xml')
| -rw-r--r-- | addons/mail/static/src/xml/thread.xml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 10194e284ea..a79085c1756 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -6,9 +6,10 @@ @param {Object} options @param {boolean} [options.displayEmptyThread] @param {boolean} [options.displayNoMatchFound] + @param {Array} [options.domain=[]] the domain to restrict messages on the thread. --> <t t-name="mail.widget.Thread"> - <t t-if="thread.hasMessages()"> + <t t-if="thread.hasMessages({ 'domain': options.domain || [] })"> <t t-call="mail.widget.Thread.Content"/> </t> <t t-elif="options.displayEmptyThread"> @@ -136,6 +137,7 @@ @param {Object} options @param {integer} [options.displayOrder] 1 or -1 ascending (respectively, descending) order for the thread messages (from top to bottom) + @param {Array} [options.domain=[]] the domain to restrict messages on the thread. @param {Object} ORDER @param {integer} ORDER.ASC=1 messages are ordered by ascending order of IDs, (from top to bottom) @param {integer} ORDER.DESC=-1 messages are ordered by descending IDs, (from top to bottom) @@ -152,7 +154,7 @@ --> <t t-name="mail.widget.Thread.Content"> - <t t-set="messages" t-value="thread.getMessages()"/> + <t t-set="messages" t-value="thread.getMessages({ 'domain': options.domain || [] })"/> <t t-if="options.displayOrder === ORDER.ASC" t-call="mail.widget.Thread.Content.ASC"/> <t t-else="" t-call="mail.widget.Thread.Content.DESC"/> </t> |
