summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread_cache
diff options
context:
space:
mode:
authorXavier Dubuc <xdu@odoo.com>2020-07-14 11:24:22 +0000
committerXavier Dubuc <xdu@odoo.com>2020-07-16 08:56:31 +0000
commit978f8ca4ef6bbae25589976e83c63000a127c1c6 (patch)
tree694909cc958060c08067669d5362562791a2cf36 /addons/mail/static/src/models/thread_cache
parenta21e8afda431281a4e0fa3c0c6e4076102a687be (diff)
[FIX] mail: fix moderation accept multiple messages button
Once global "Accept" button is clicked, the accepted messages were not unchecked causing the button to stay hidden until next page reload. task-2285430 closes odoo/odoo#54549 X-original-commit: 5594de16f463507498e852c2d49d1cbe74ed7381 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread_cache')
-rw-r--r--addons/mail/static/src/models/thread_cache/thread_cache.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/mail/static/src/models/thread_cache/thread_cache.js b/addons/mail/static/src/models/thread_cache/thread_cache.js
index b942e0a6e08..4fdcaed6114 100644
--- a/addons/mail/static/src/models/thread_cache/thread_cache.js
+++ b/addons/mail/static/src/models/thread_cache/thread_cache.js
@@ -96,6 +96,16 @@ function factory(dependencies) {
/**
* @private
+ */
+ _computeCheckedMessages() {
+ const messagesWithoutCheckbox = this.checkedMessages.filter(
+ message => !message.hasCheckbox
+ );
+ return [['unlink', messagesWithoutCheckbox]];
+ }
+
+ /**
+ * @private
* @returns {mail.message[]}
*/
_computeFetchedMessages() {
@@ -286,6 +296,11 @@ function factory(dependencies) {
ThreadCache.fields = {
checkedMessages: many2many('mail.message', {
+ compute: '_computeCheckedMessages',
+ dependencies: [
+ 'checkedMessages',
+ 'messagesCheckboxes',
+ ],
inverse: 'checkedThreadCaches',
}),
/**