Skip to content

Conversation

@syci
Copy link

@syci syci commented Feb 11, 2026

T19363 @BinhexTeam : Add Restriction Method (Whitelist/Blacklist) & Fix Context Bug

Problem: Currently, the module only operates on a "Blacklist" logic: if a user belongs to the selected groups, the restriction (invisible/readonly/required) is applied. It is difficult to achieve the opposite scenario: "Restrict this field for everyone, EXCEPT for this specific group" (Whitelist). For example, making a field Readonly for everyone except the "Sales Manager". To achieve this currently, one would need to select all other groups in the system, which is inefficient and hard to maintain.

Solution: This PR introduces a new configuration option restriction_method to the restriction rules:

Restrict these groups (Blacklist): Default behavior. The restriction applies if the user has one of the selected groups.

Restrict everyone EXCEPT these groups (Whitelist): New behavior. The restriction applies if the user does not have any of the selected groups.

Bug Fix: Fixed a ValidationError when creating rules from the "All Fields Restrictions" menu. Previously, the context caused required fields for different restriction types (Invisible/Readonly/Required) to conflict, preventing the creation of a rule if fields for other types were empty. The XML view attributes have been updated to handle the hide_title context correctly.

@OCA-git-bot
Copy link
Contributor

Hi @ilyasProgrammer,
some modules you are maintaining are being modified, check this out!

@legalsylvain legalsylvain marked this pull request as draft February 11, 2026 17:36
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.

2 participants