diff --git a/addons/account_edi/models/account_edi_document.py b/addons/account_edi/models/account_edi_document.py index 10de7724c3d..f6d97ba869d 100644 --- a/addons/account_edi/models/account_edi_document.py +++ b/addons/account_edi/models/account_edi_document.py @@ -283,4 +283,8 @@ class AccountEdiDocument(models.Model): if not (attachment_sudo.res_model and attachment_sudo.res_id): # do not return system attachment not linked to a record return {} + if len(self._context.get('active_ids', [])) > 1: + # In mass mail mode 'attachments_ids' is removed from template values + # as they should not be rendered + return {'attachments': [(attachment_sudo.name, attachment_sudo.datas)]} return {'attachment_ids': attachment_sudo.ids}