summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread/thread.js
diff options
context:
space:
mode:
authorFrancois (fge) <fge@odoo.com>2020-09-11 15:54:13 +0000
committerFrancois (fge) <fge@odoo.com>2020-09-14 10:32:55 +0000
commitdcf4bb5a58a1be8102bfa2a8997711f31b7d6a32 (patch)
treefa6042a0f16d3b358d0af130e035b6f4ec3e1201 /addons/mail/static/src/models/thread/thread.js
parent18d4e3327c7152b4c3a86ba377e3357f213b703c (diff)
[FIX] mail: no longer display unlinked attachments in chatter
Task-2337952 closes odoo/odoo#57627 X-original-commit: 55cb4a82ce2b59bc73ea05afa5971c96989b6159 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread/thread.js')
-rw-r--r--addons/mail/static/src/models/thread/thread.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js
index efd33f9a0ce..ea67741f9a5 100644
--- a/addons/mail/static/src/models/thread/thread.js
+++ b/addons/mail/static/src/models/thread/thread.js
@@ -418,11 +418,13 @@ function factory(dependencies) {
fields: ['id', 'name', 'mimetype'],
orderBy: [{ name: 'id', asc: false }],
}));
- for (const attachmentData of attachmentsData) {
- this.env.models['mail.attachment'].insert(Object.assign({
- originThread: [['link', this]],
- }, this.env.models['mail.attachment'].convertData(attachmentData)));
- }
+ this.update({
+ originThreadAttachments: [['insert-and-replace',
+ attachmentsData.map(data =>
+ this.env.models['mail.attachment'].convertData(data)
+ )
+ ]],
+ });
this.update({ areAttachmentsLoaded: true });
}