[FIX] account: when an attachment is submited and an invoice is sucessfully parsed it is posted in the chatter

Before this commit, the attachment was only posted if no decoder was able to parse the attachment.

See https://github.com/odoo/enterprise/pull/16138

closes odoo/odoo#65878

X-original-commit: d583de02392b7738e7eead4ef33f91ef8a47b0f6
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:
Benjamin Frantzen (bfr)
2021-02-10 13:21:12 +00:00
parent 513a91d673
commit 0fcab51a26
+1 -1
View File
@@ -621,7 +621,7 @@ class AccountJournal(models.Model):
break
if not invoice:
invoice = self.env['account.move'].create({})
invoice.with_context(no_new_invoice=True).message_post(attachment_ids=[attachment.id])
invoice.with_context(no_new_invoice=True).message_post(attachment_ids=[attachment.id])
invoices += invoice
action_vals = {