Skip to content

[18.0][FIX] mis_builder: fix multi-company account display#4

Open
dnplkndll wants to merge 1 commit into
18.0from
18.0-fix-multicompany-accounts
Open

[18.0][FIX] mis_builder: fix multi-company account display#4
dnplkndll wants to merge 1 commit into
18.0from
18.0-fix-multicompany-accounts

Conversation

@dnplkndll
Copy link
Copy Markdown

@dnplkndll dnplkndll commented Mar 24, 2026

Summary

Fixes multi-company MIS report issues in Odoo 18:

  1. company_idcompany_ids: account.account.company_id was replaced by company_ids (Many2many) in Odoo 18. _get_account_name crashed on multi-company reports.

  2. False account codes: account.code is now company-dependent (stored in code_store jsonb). When viewing a report from a different company context, codes displayed as "False". Fix uses with_company() to read codes from the account's owning company.

  3. query_companies threading: Passes company context through KpiMatrix and prepare_kpi_matrix() for proper multi-company resolution.

Screenshots (after fix)

Report Instance Configuration

Report Instance

Rendered Report — Account Codes Correct

Account codes like "600000 Expenses" and "211000 Account Payable" render correctly (previously showed "False"):

Report View

Report Instances List

List View

Files changed

  • mis_builder/models/kpimatrix.py — accept query_companies param
  • mis_builder/models/mis_report.py — thread query_companies through prepare_kpi_matrix()
  • mis_builder/models/mis_report_instance.py — use with_company() for account name resolution
  • mis_builder/tests/test_mis_report_instance.py — multi-company test cases

CI

  • Pre-commit: ✅ All passed
  • OCA tests: ❌ Docker Hub rate limit (not a code issue — postgres:12.0 pull failed)

Related

🤖 Generated with Claude Code

@dnplkndll dnplkndll force-pushed the 18.0-fix-multicompany-accounts branch from 6f419d5 to 2ae2aed Compare March 27, 2026 15:45
@dnplkndll dnplkndll changed the title [18.0][FIX] mis_builder: fix multi-company account display + migration [18.0][FIX] mis_builder: fix multi-company account display Mar 27, 2026
@dnplkndll dnplkndll force-pushed the 18.0-fix-multicompany-accounts branch 7 times, most recently from 1d780b5 to 9ef9acc Compare March 28, 2026 01:10
Fixes multi-company MIS report issues in Odoo 18:

1. `account.account.company_id` was replaced by `company_ids` (Many2many)
   in Odoo 18. `_get_account_name` crashed on multi-company reports.

2. `account.code` is now company-dependent (stored in `code_store` jsonb).
   When viewing a report from a different company context, codes
   displayed as "False". Fix uses `with_company()` to read codes from
   the account's owning company.

3. Threads `query_companies` through `KpiMatrix` and `prepare_kpi_matrix()`
   for proper multi-company context resolution.

Closes OCA#779
@dnplkndll dnplkndll force-pushed the 18.0-fix-multicompany-accounts branch from 9ef9acc to dbef4ee Compare May 13, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[18.0][BUG] Account codes show as 'False' in auto_expand_accounts for multi-company reports

1 participant