[FIX] account: rule error when creating an invoice from the Documents app

Steps to reproduce:
- Install Odoo with demo data, multiple companies and multiple users
- Go to Documents app
- Finance workspace
- Select a demo pdf
- Create invoice
- Error because of 'Mail Compose Message Rule'

The fix removes a non-necessary line when creating an invoice from a pdf

closes odoo/odoo#109032

X-original-commit: e5b60e6af030374972b36cb3cb61a38109da78e7
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
This commit is contained in:
Ricardo Gomes Rodrigues (rigr)
2023-01-04 07:12:47 +01:00
parent 23bc24873d
commit 880665a6e3
-1
View File
@@ -708,7 +708,6 @@ class AccountJournal(models.Model):
invoices = self.env['account.move']
with invoices._disable_discount_precision():
for attachment in attachments:
attachment.write({'res_model': 'mail.compose.message'})
decoders = self.env['account.move']._get_create_document_from_attachment_decoders()
invoice = False
for decoder in sorted(decoders, key=lambda d: d[0]):