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
This commit is contained in:
Cédric Krier
2024-04-10 17:56:20 +02:00
parent 78a6017ae8
commit 8fc1fe62e7
+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(