Check no account attribute.

This commit refs #21072
This commit is contained in:
Sergio Morillo 2021-11-30 15:57:19 +01:00
parent ff82575845
commit 23898b44f8
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class PurchaseLine(metaclass=PoolMeta):
for entry_acc in self.analytic_accounts:
accounts = AnalyticAccount.search(
self.get_party_analytic_account_domain(entry_acc.root))
if accounts and not entry_acc.account:
if accounts and not getattr(entry_acc, 'account', None):
entry_acc.account = accounts[0]
@fields.depends('purchase', '_parent_purchase.company',