From 2f033d718456d8698441620dace4647e96e99931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rahir?= Date: Wed, 5 Sep 2018 11:04:29 +0200 Subject: [PATCH] [FIX] account_facturx: fix condition on _post_pdf The override on _post_pdf should only be triggered when there is only one record. The if statement was faulty. --- addons/account_facturx/models/ir_actions_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_facturx/models/ir_actions_report.py b/addons/account_facturx/models/ir_actions_report.py index 9e1d1f179a5..46028f40244 100644 --- a/addons/account_facturx/models/ir_actions_report.py +++ b/addons/account_facturx/models/ir_actions_report.py @@ -13,7 +13,7 @@ class IrActionsReport(models.Model): @api.multi def _post_pdf(self, save_in_attachment, pdf_content=None, res_ids=None): # OVERRIDE - if self.model == 'account.invoice' and (res_ids or len(res_ids) == 1): + if self.model == 'account.invoice' and res_ids and len(res_ids) == 1: invoice = self.env['account.invoice'].browse(res_ids) if invoice.type in ('out_invoice', 'out_refund') and invoice.state != 'draft': xml_content = invoice._export_as_facturx_xml()