summaryrefslogtreecommitdiff
path: root/addons/mail/wizard/mail_compose_message.py
diff options
context:
space:
mode:
authorNans Lefebvre <len@odoo.com>2019-05-21 11:44:12 +0000
committerNans Lefebvre <len@odoo.com>2019-05-24 13:45:50 +0000
commit4c3698aa3f0a6a674d0a452e9a85909f727e057f (patch)
treec840455ff85e684897981b2eb381f18b9b2ef292 /addons/mail/wizard/mail_compose_message.py
parentb45236dd688d7b7054412ae96d755a03a7590b91 (diff)
[FIX] mail: add all attachments at template onchange
Fine-tuning of 516f22c3987. This commit missed attachments that are linked to a mail.template, which should be added to every mail sent using the template. To make sure that we both fix the duplicates and the generation issue, we add a test. opw 2000515 opw 1998782 closes odoo/odoo#33653 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
-rw-r--r--addons/mail/wizard/mail_compose_message.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index dcaf346e139..913ca46bce9 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -414,6 +414,7 @@ class MailComposer(models.TransientModel):
# ORM handle the assignation of command list on new onchange (api.v8),
# this force the complete replacement of x2many field with
# command and is compatible with onchange api.v7
+ attachment_ids += values.pop('attachment_ids' , [])
values = self._convert_to_write(values)
if attachment_ids:
values.update(attachment_ids=[(6, 0, attachment_ids)])