[FIX] account_edi: multi record send&print

With an EDI localization (MX)
Create 2+ invoices with edi attachments (xml)
In list view, select both and hit actions > send&print

Issue: EDI file will not be attached to the mail

opw-3330554

closes odoo/odoo#124446

X-original-commit: 9730a9753936f040a987505ed064cfd51acb50e0
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2023-06-12 12:41:08 +02:00
parent 114736ba49
commit f95e49beb0
@@ -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}