Repository navigation
[18.0][FIX] hr_collective_agreement: load the multi-company record rule - #1645
Open
parabol123654 wants to merge 1 commit into
Open
parabol123654 wants to merge 1 commit into
parabol123654 wants to merge 1 commit into
Conversation
security/collective_agreement_security.xml was never listed in the manifest, so collective agreements of every company were visible to users of any company. Load the file. Its second rule is dropped: it referenced a group that does not exist (base.group_hr_manager, the module would not install) and, with a [(1, '=', 1)] domain, would have let HR managers bypass the multi-company rule. Assisted-by: Claude Opus 5.5
parabol123654
force-pushed
the
18.0-fix-hr_collective_agreement-company-rule
branch
from
November 14, 2026 18:28
ccaa886 to
77a77c5
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.
hr_collective_agreement/security/collective_agreement_security.xmldefines the multi-company rule ofcollective.agreement:The file is not listed in the manifest, so the rule is never loaded. As a result, a user who only has access to company B sees (and can open) the collective agreements of company A.
Changes:
Manifest: add the file to the manifest.
Second rule removed (
collective_agreement_rule_partner_manager), for two reasons:base.group_hr_manager, which does not exist (the group ishr.group_hr_manager). Loading the file as it is would fail the module install.[(1, '=', 1)], so it would let HR managers see every company's agreements and bypass the multi-company rule. Corehrhas no such exception.If an HR-manager exception is actually wanted, I can restore it with
hr.group_hr_managerinstead.Test:
test_multi_company_rulechecks that an employee and an HR manager of another company see only that company's agreements.collective.agreement(1,) unexpectedly found in collective.agreement(1, 7).hr_collective_agreementpasses 11/11 andhr_collective_agreement_partnerpasses 5/5.The module is not on 19.0 yet.
Assisted-by: Claude Opus 5.5