From d31e260646a1edb03395a7ec73e6b9dac7b2825a Mon Sep 17 00:00:00 2001 From: "Benjamin Frantzen (bfr)" Date: Mon, 2 Nov 2020 14:00:30 +0000 Subject: [PATCH] [FIX] account_edi: prevent a failed edi import to be imported again When creating an invoice from an attachment fails, we call super() which creates a new invoice and post the attachment to it without the `no_new_invoice` context key. This triggers an new import of the attachment. closes odoo/odoo#61191 X-original-commit: 034625f2ade73f368f97e583b83db86372ae8001 Signed-off-by: Laurent Smet Signed-off-by: bfr-o --- addons/account_edi/models/account_journal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_edi/models/account_journal.py b/addons/account_edi/models/account_journal.py index ecc82632f99..21503fe004f 100644 --- a/addons/account_edi/models/account_journal.py +++ b/addons/account_edi/models/account_journal.py @@ -59,4 +59,4 @@ class AccountJournal(models.Model): # with_context: we don't want to import the attachment since the invoice was just created from it. invoice.with_context(no_new_invoice=True).message_post(attachment_ids=attachment.ids) return invoice - return super()._create_invoice_from_single_attachment(attachment) + return super(AccountJournal, self.with_context(no_new_invoice=True))._create_invoice_from_single_attachment(attachment)