From f7b41a3a0778992b22584e7d8fd52346cbaaed70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 25 Nov 2025 16:02:52 +0100 Subject: [PATCH] Set analytic account on closing move of asset also when it is an expense Closes #14390 --- modules/analytic_invoice/asset.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/analytic_invoice/asset.py b/modules/analytic_invoice/asset.py index 8e430399de..0db51ef32c 100644 --- a/modules/analytic_invoice/asset.py +++ b/modules/analytic_invoice/asset.py @@ -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):