[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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user