Repository navigation
Conversation
In standard Odoo 19, account codes (`code_store`) are company-dependent. For this reason, `mis_builder`'s `AccountingExpressionProcessor` (`AEP._done_parsing_search_accounts`) searches matching accounts by iterating over every company individually (`with_company(company)`). In multi-company environments, this generates `N_companies * N_unique_domains` search queries. With `account_code_single_company` installed, accounts linked to a single company store their code in `code_store_single_company`. Searching accounts by code operates across companies without being restricted to the active context company. This module patches `AccountingExpressionProcessor._done_parsing_search_accounts` to execute a single search query per unique account domain across all targeted companies (`company_ids in self.companies.ids`). This eliminates the loop over companies and reduces the query count to `N_unique_domains`, significantly speeding up MIS report parsing in multi-company setups.
petrus-v
force-pushed
the
19.0-add-odoo-addon-mis-builder-account-code-single-company
branch
from
October 16, 2026 07:55
6a676de to
7840818
Compare
petrus-v
force-pushed
the
19.0-add-odoo-addon-mis-builder-account-code-single-company
branch
from
October 16, 2026 08:01
7840818 to
d15eb1d
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.
In standard Odoo 19, account codes (
code_store) are company-dependent.For this reason,
mis_builder'sAccountingExpressionProcessor(AEP._done_parsing_search_accounts)searches matching accounts by iterating over every company individually
(
with_company(company)). In multi-company environments, this generatesN_companies * N_unique_domainssearch queries.With
account_code_single_companyinstalled, accounts linked to a singlecompany store their code in
code_store_single_company.Searching accounts by code operates across companies without
being restricted to the active context company.
This module patches
AccountingExpressionProcessor._done_parsing_search_accountsto execute a single search query per unique account domain across
all targeted companies (
company_ids in self.companies.ids).This eliminates the loop over companies and reduces the query count
to
N_unique_domains, significantly speeding up MIS report parsingin multi-company setups.