summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_thread.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-03-13 15:53:55 +0100
committerChristophe Simonis <chs@odoo.com>2017-03-13 15:53:55 +0100
commit2ef43281c26b7511f4a884530ff01db876fc5ad2 (patch)
tree0c1ce89344bfb77f222fbf0fb6cc24f2743be2a5 /addons/mail/models/mail_thread.py
parente88bb57a1ed6c4b5494c217c47a22b9509f8e1fb (diff)
parent2e972578b92202eeb53c3d581965bc0095535d6d (diff)
[MERGE] forward port branch saas-11 up to 2e972578b92
Diffstat (limited to 'addons/mail/models/mail_thread.py')
-rw-r--r--addons/mail/models/mail_thread.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index 9589bab1278..d94b263449e 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -1368,9 +1368,9 @@ class MailThread(models.AbstractModel):
to_remove.append(node)
if node.tag == 'img' and node.get('src', '').startswith('cid:'):
cid = node.get('src').split(':', 1)[1]
- related_attachment = [attach for attach in attachments if len(attach) == 2 and attach[2] == cid]
+ related_attachment = [attach for attach in attachments if attach[2] and attach[2].get('cid') == cid]
if related_attachment:
- node.set('data-filename', related_attachment[0])
+ node.set('data-filename', related_attachment[0][0])
postprocessed = True
for node in to_remove: