From 5d579dd8ed8942e3ca2930341352e11b5f608fb0 Mon Sep 17 00:00:00 2001 From: bobrador Date: Thu, 3 Apr 2025 14:39:12 +0200 Subject: [PATCH] [IMP] account_financial_report: Added code for analytic accounts in general leadger --- account_financial_report/report/general_ledger.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/account_financial_report/report/general_ledger.py b/account_financial_report/report/general_ledger.py index eff12a0c..97689c6a 100644 --- a/account_financial_report/report/general_ledger.py +++ b/account_financial_report/report/general_ledger.py @@ -18,11 +18,12 @@ class GeneralLedgerReport(models.AbstractModel): def _get_analytic_data(self, account_ids): analytic_accounts = self.env["account.analytic.account"].search_fetch( - [("id", "in", account_ids)], ["name"] + [("id", "in", account_ids)], ["name", "code"] ) analytic_data = {} for account in analytic_accounts: - analytic_data.update({account.id: {"name": account.name}}) + name = f"[{account.code}] {account.name}" if account.code else account.name + analytic_data.update({account.id: {"name": name}}) return analytic_data def _get_taxes_data(self, taxes_ids):