[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 <smetl@users.noreply.github.com> Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user