Skip to content

[16.0][FIX] purchase_request_operating_unit: fix all-OU access group bypass - #1291

Merged
madara1150 merged 1 commit into
16.0from
madara1150/purchase-request-ou-access-bug
Sep 10, 2026
Merged

[16.0][FIX] purchase_request_operating_unit: fix all-OU access group bypass#1291
madara1150 merged 1 commit into
16.0from
madara1150/purchase-request-ou-access-bug

Conversation

@madara1150

Copy link
Copy Markdown
Collaborator

Summary

  • Convert ir_rule_purchase_request_operating_units and ir_rule_purchase_request_line_allowed_operating_units from global=True to non-global rules scoped to group_purchase_request_user, so Odoo's OR logic between non-global rules can be leveraged for bypass.
  • Replace the <function> domain-patch hack in purchase_request_operating_unit_access_all with proper ir.rule bypass records (domain_force=[(1,'=',1)]) scoped to group_all_ou_purchase_request.
  • Move the group definition into <data noupdate="1"> in the access-all module.

Test plan

  • Upgrade both modules: -u purchase_request_operating_unit,purchase_request_operating_unit_access_all
  • User without group_all_ou_purchase_request: can only see PRs in their own OUs
  • User with group_all_ou_purchase_request: can see PRs across all OUs

Convert global OU record rules to non-global (group_purchase_request_user)
so the all-OU bypass group in purchase_request_operating_unit_access_all
can OR-override them via standard Odoo non-global rule mechanics.
Replace hacky <function> domain patch with proper bypass ir.rule records.
@madara1150
madara1150 requested a review from n3n September 10, 2026 10:30
@madara1150 madara1150 added the status/ready-for-review Status: Issue is up for grabs label Sep 10, 2026
@madara1150
madara1150 merged commit b8cf751 into 16.0 Sep 10, 2026
1 check passed
@madara1150
madara1150 deleted the madara1150/purchase-request-ou-access-bug branch September 10, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/ready-for-review Status: Issue is up for grabs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants