[FIX] account: prevent traceback while add multiple attachment in chatter

the error will occur when adding more than one attachment to draft invoice
chatter and click on send button.

applying these changes will resolve this issue.

sentry-4059207297

closes odoo/odoo#120238

X-original-commit: a2fcf96df23a7eea7ff9ddb94798e8375590ae28
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Smit Nagar (smna) <smna@odoo.com>
This commit is contained in:
smna-odoo
2023-05-11 12:01:40 +02:00
parent e3ad1eb058
commit 7a10c2756b
+1 -1
View File
@@ -136,7 +136,7 @@ class IrAttachment(models.Model):
for attachement in self:
supported_formats = attachement._get_edi_supported_formats()
for supported_format in supported_formats:
if supported_format['check'](self):
if supported_format['check'](attachement):
to_process += supported_format['decoder'](attachement.name, attachement.raw)
to_process.sort(key=lambda x: x['sort_weight'])