From dba09e4874b34dbf52ab8e018996f1caf460a3b2 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Fri, 29 Jul 2022 10:32:40 +0000 Subject: [PATCH] [FIX] l10n_it_edi: attachments from xml missing res_model/res_id Install Documents Open Settings > Documents, enable 'Accounting' files centralization Configure 'Journals' with a single line - Journal -> Vendor Bills - Workspace -> Finance / Supplier Invoices Now in go to Accounting>Vendor>Bills Upload an xml representing a vendor bill, including an attachment encoded in the tag Open created bill Traceback. The error is caused by the attachment included in the xml registered without res_id/res_model. In the document flow the attachment will receive a res_id, but not the res_model, causing the traceback when retrieving the attachment opw-2919610 closes odoo/odoo#97277 X-original-commit: 377e8eedb2ceb444d6b331debdffa17c47e4a898 Signed-off-by: Josse Colpaert Signed-off-by: Grazioso Andrea (agr) --- addons/l10n_it_edi/models/account_edi_format.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/l10n_it_edi/models/account_edi_format.py b/addons/l10n_it_edi/models/account_edi_format.py index 2042fb8a6bb..4a743977ce1 100644 --- a/addons/l10n_it_edi/models/account_edi_format.py +++ b/addons/l10n_it_edi/models/account_edi_format.py @@ -737,6 +737,8 @@ class AccountEdiFormat(models.Model): 'name': name_attachment, 'datas': attachment_64, 'type': 'binary', + 'res_model': 'account.move', + 'res_id': new_invoice.id, }) # default_res_id is had to context to avoid facturx to import his content