From 9825bc7c3c989dad44bb43dcd35798ac169a9a95 Mon Sep 17 00:00:00 2001 From: Thomas Beckers Date: Mon, 10 May 2021 13:59:41 +0000 Subject: [PATCH] [FIX] account_edi_facturx: avoid crash when no edi attachment When we get the values to embed to pdf, these values can be False if there is no edi attachment on the account_move so try to assign something to 'values' will fail. Now there is a check before assignment. opw-2526280 closes odoo/odoo#70629 X-original-commit: e1659f8a9041d409d0d303a7c12342b2e73675c7 Signed-off-by: Josse Colpaert --- addons/account_edi_facturx/models/account_edi_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_edi_facturx/models/account_edi_format.py b/addons/account_edi_facturx/models/account_edi_format.py index 8432c506af0..e66d9b63cd3 100644 --- a/addons/account_edi_facturx/models/account_edi_format.py +++ b/addons/account_edi_facturx/models/account_edi_format.py @@ -40,7 +40,7 @@ class AccountEdiFormat(models.Model): def _get_embedding_to_invoice_pdf_values(self, invoice): values = super()._get_embedding_to_invoice_pdf_values(invoice) - if self.code == 'facturx_1_0_05': + if values and self.code == 'facturx_1_0_05': values['name'] = 'factur-x.xml' return values