From cb05e89c7e71f6d7f7c623bd5b33b3464849b588 Mon Sep 17 00:00:00 2001 From: ThiagoMForgeFlow Date: Wed, 19 Nov 2025 11:44:43 +0100 Subject: [PATCH] [FIX] mis_builder: adapt account codes for reports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In version 18, Odoo displays the account codes using the placeholder_code field when it’s a company that is not the main active one. With this change, the code of each account is shown correctly in multi-company reports. --- mis_builder/models/kpimatrix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mis_builder/models/kpimatrix.py b/mis_builder/models/kpimatrix.py index dc23b12a7..09245a3a1 100644 --- a/mis_builder/models/kpimatrix.py +++ b/mis_builder/models/kpimatrix.py @@ -467,7 +467,8 @@ def _load_account_names(self): self._account_names = {a.id: self._get_account_name(a) for a in accounts} def _get_account_name(self, account): - result = f"{account.code} {account.name}" + code = account.code or account.placeholder_code.split(" (")[0] + result = f"{code} {account.name}" if self._multi_company: result = f"{result} [{account.company_id.name}]" return result