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/js/thread_widget.js | |
| 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/js/thread_widget.js')
| -rw-r--r-- | addons/mail/static/src/js/thread_widget.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/thread_widget.js b/addons/mail/static/src/js/thread_widget.js index d2e98d2c99a..a5822a03e39 100644 --- a/addons/mail/static/src/js/thread_widget.js +++ b/addons/mail/static/src/js/thread_widget.js @@ -102,6 +102,8 @@ var ThreadWidget = Widget.extend({ * - ORDER.ASC: last message is at the bottom of the thread * - ORDER.DESC: last message is at the top of the thread * @param {boolean} [options.displayLoadMore] + * @param {Array} [options.domain=[]] the domain for the messages in the + * thread. * @param {boolean} [options.isCreateMode] * @param {boolean} [options.scrollToBottom=false] * @param {boolean} [options.squashCloseMessages] @@ -116,7 +118,7 @@ var ThreadWidget = Widget.extend({ this._currentThreadID = thread.getID(); // copy so that reverse do not alter order in the thread object - var messages = _.clone(thread.getMessages()); + var messages = _.clone(thread.getMessages({ domain: options.domain || [] })); var modeOptions = options.isCreateMode ? this._disabledOptions : this._enabledOptions; |
