[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 <jco@openerp.com>
This commit is contained in:
Thomas Beckers
2021-05-10 17:22:11 +00:00
parent dd98184c43
commit 9825bc7c3c
@@ -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