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
This commit is contained in:
Cédric Krier
2024-04-10 17:56:20 +02:00
parent 1f470cb4d1
commit 4ecca33e0e
+1 -1
View File
@@ -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(