From 7a10c2756bcb7271c15c29be6537fcac935eb3f1 Mon Sep 17 00:00:00 2001 From: smna-odoo Date: Fri, 28 Apr 2023 05:15:10 +0000 Subject: [PATCH] [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) Signed-off-by: Smit Nagar (smna) --- addons/account/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/ir_attachment.py b/addons/account/models/ir_attachment.py index 516f955675d..518fdc6001f 100644 --- a/addons/account/models/ir_attachment.py +++ b/addons/account/models/ir_attachment.py @@ -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'])