From 8fc1fe62e79a33fa051675f08948e57fc18c5852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 10 Apr 2024 17:56:20 +0200 Subject: [PATCH] Do not fail when testing if account is set on invoice line for project If there is no product defined on the project, the call to on_change_product for the invoice line does not set the account field. Closes #13111 (grafted from 01992016f36efdf8576a2453a084ba642e43d74f) --HG-- branch : 7.0 --- modules/project_invoice/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/project_invoice/project.py b/modules/project_invoice/project.py index 48e370f25d..3e09ab58d9 100644 --- a/modules/project_invoice/project.py +++ b/modules/project_invoice/project.py @@ -592,7 +592,7 @@ class Work(Effort, Progress, Timesheet, metaclass=PoolMeta): invoice_line.unit = key['unit'] invoice_line.product = product invoice_line.on_change_product() - if not invoice_line.account: + if not getattr(invoice_line, 'account', None): if invoice_line.product: raise InvoicingError( gettext(