[18.0][FIX] mis_builder: fix multi-company account display#4
Open
dnplkndll wants to merge 1 commit into
Open
Conversation
6f419d5 to
2ae2aed
Compare
1 task
1d780b5 to
9ef9acc
Compare
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
9ef9acc to
dbef4ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes multi-company MIS report issues in Odoo 18:
company_id→company_ids:account.account.company_idwas replaced bycompany_ids(Many2many) in Odoo 18._get_account_namecrashed on multi-company reports.False account codes:
account.codeis now company-dependent (stored incode_storejsonb). When viewing a report from a different company context, codes displayed as "False". Fix useswith_company()to read codes from the account's owning company.query_companiesthreading: Passes company context throughKpiMatrixandprepare_kpi_matrix()for proper multi-company resolution.Screenshots (after fix)
Report Instance Configuration
Rendered Report — Account Codes Correct
Account codes like "600000 Expenses" and "211000 Account Payable" render correctly (previously showed "False"):
Report Instances List
Files changed
mis_builder/models/kpimatrix.py— acceptquery_companiesparammis_builder/models/mis_report.py— threadquery_companiesthroughprepare_kpi_matrix()mis_builder/models/mis_report_instance.py— usewith_company()for account name resolutionmis_builder/tests/test_mis_report_instance.py— multi-company test casesCI
postgres:12.0pull failed)Related
🤖 Generated with Claude Code