Repository navigation
[19.0][FIX] base_comment_template: fix model_ids search - #1216
Open
Ricardoalso wants to merge 1 commit into
Open
Ricardoalso wants to merge 1 commit into
Ricardoalso wants to merge 1 commit into
Conversation
In 19.0, the domain optimizer rewrites conditions on model_ids before
calling _search_model_ids: a string value becomes an 'any' on
display_name, and the 'any' sub-domain is first searched on ir.model as
the current user. ir.model is only readable by the "Access Rights"
group, so any other user filtering on model_ids (e.g. the purchase or
sale "Document Comments" menus) got an AccessError. The search method
also never matched, since it compared a Domain to technical names.
Set bypass_search_access on model_ids and handle the 'any'/'in'
operators: resolve the ir.model records as superuser and match their
technical names against the stored `models` field. Keep supporting the
direct _search_model_ids("in", <model name>) calls from
comment.template.
1 task
ivantodorovich
approved these changes
Oct 14, 2026
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 19.0, the domain optimizer rewrites conditions on model_ids before calling _search_model_ids: a string value becomes an 'any' on display_name, and the 'any' sub-domain is first searched on ir.model as the current user. ir.model is only readable by the "Access Rights" group, so any other user filtering on model_ids (e.g. the purchase or sale "Document Comments" menus) got an AccessError. The search method also never matched, since it compared a Domain to technical names.
Set bypass_search_access on model_ids and handle the 'any'/'in' operators: resolve the ir.model records as superuser and match their technical names against the stored
modelsfield. Keep supporting the direct _search_model_ids("in", ) calls from comment.template.