[16.0] [FIX] sale_commission_agent_restrict: change res_partner form view restriction to _get_view#676
Open
rrebollo wants to merge 1 commit into
Conversation
Contributor
|
Hi @aleuffre, |
…triction to _get_view
4165380 to
d8e3a91
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.
Why this change was made
Root cause: Odoo PR #95729, merged in Odoo 16.0, unified the behavior of the
groupsattribute across the framework.Before 16.0
When
groupswas applied to an XML node in a back-end view, the node was only made invisible — it remained in the view architecture. Third-party modules could reliably:After 16.0
The
groupsattribute completely removes the node from the view architecture for users outside the group — matching the long-standing behavior ofgroupson Python model fields. The PR description states this was done to:The problem this caused
The old XML in
sale_commission_agent_restrictused:In Odoo 16.0, those pages are stripped from the arch entirely for agent users. Any third-party module that references those pages (e.g., xpath="//page[@name='sales_purchases']") gets an error because the node no longer exists. Code that worked in 15.0 silently breaks in 16.0.
Why _get_view() is better
The Python override keeps the pages in the arch and sets invisible="1" at runtime. The nodes remain present for:
This is both safer (no breaking changes for dependant modules) and more reliable (explicit control over visibility logic).
One commit cherry-picked from #675
@BinhexTeam T21484