Set analytic account on closing move of asset also when it is an expense

Closes #14390
This commit is contained in:
Cédric Krier
2025-11-25 16:02:52 +01:00
parent 76cc0945e3
commit f7b41a3a07
+9 -2
View File
@@ -41,8 +41,15 @@ class Asset(AnalyticMixin, metaclass=PoolMeta):
def get_closing_move(self, account, date=None):
move = super().get_closing_move(account, date=date)
self.set_analytic_lines(
move, account or self.product.account_revenue_used)
if not account:
accounts = [
self.product.account_revenue_used,
self.product.account_expense_used,
]
else:
accounts = [account]
for account in accounts:
self.set_analytic_lines(move, account)
return move
def set_analytic_lines(self, move, account):