Skip to content

[18.0][FIX] hr modules: employees readable by internal users (fields without groups) - #1666

Open
parabol123654 wants to merge 6 commits into
OCA:18.0from
parabol123654:18.0-fix-hr-employee-fields-groups
Open

parabol123654 wants to merge 6 commits into
OCA:18.0from
parabol123654:18.0-fix-hr-employee-fields-groups

Conversation

@parabol123654

@parabol123654 parabol123654 commented Nov 12, 2026 •

Copy link
Copy Markdown

Fixes #1665. This is the follow-up of #1662 (approved), which does the same for hr_employee_calendar_planning, hr_appraisal_oca and hr_course.

There is one commit per module. Each commit adds groups="hr.group_hr_user" to the fields its module adds on hr.employee, which are not on hr.employee.public:

  • hr_employee_language: language_ids
  • hr_employee_medical_examination: medical_examination_ids, medical_examination_count, can_see_examinations_button
  • hr_employee_relative: relative_ids
  • hr_employee_service: service_termination_date
  • hr_employee_service_contract: first_contract_id, last_contract_id
  • hr_personal_equipment_request: equipment_request_ids, personal_equipment_ids, equipment_request_count, personal_equipment_count

All these fields are only used in hr.view_employee_form, which only HR officers open, so nobody loses anything. The stat buttons whose invisible depends on these fields get the same group. This avoids the "Access Rights Inconsistency" view warning that the CI turns into an error.

Tests: each module gets test_read_own_employee_internal_user. An internal user reads its own employee with the fields of the module it may access, as read([]) does. The test only looks at the fields of its own module, so it does not depend on the other modules of the repo.

Assisted-by: Claude Opus 5.5

The fields this module adds on hr.employee are not on hr.employee.public
and had no groups. Users without HR rights read employees through
hr.employee.public, so a read of all the fields of an employee (read([]),
search_read without fields, e.g. from an API client) raised "The fields
..., which you are trying to read, are not available for employee public
profiles". Restrict them to HR officers, as core does for such fields.

Assisted-by: Claude Opus 5.5
… users

The fields this module adds on hr.employee are not on hr.employee.public
and had no groups. Users without HR rights read employees through
hr.employee.public, so a read of all the fields of an employee (read([]),
search_read without fields, e.g. from an API client) raised "The fields
..., which you are trying to read, are not available for employee public
profiles". Restrict them to HR officers, as core does for such fields.

Assisted-by: Claude Opus 5.5
The fields this module adds on hr.employee are not on hr.employee.public
and had no groups. Users without HR rights read employees through
hr.employee.public, so a read of all the fields of an employee (read([]),
search_read without fields, e.g. from an API client) raised "The fields
..., which you are trying to read, are not available for employee public
profiles". Restrict them to HR officers, as core does for such fields.

Assisted-by: Claude Opus 5.5
The fields this module adds on hr.employee are not on hr.employee.public
and had no groups. Users without HR rights read employees through
hr.employee.public, so a read of all the fields of an employee (read([]),
search_read without fields, e.g. from an API client) raised "The fields
..., which you are trying to read, are not available for employee public
profiles". Restrict them to HR officers, as core does for such fields.

Assisted-by: Claude Opus 5.5
The fields this module adds on hr.employee are not on hr.employee.public
and had no groups. Users without HR rights read employees through
hr.employee.public, so a read of all the fields of an employee (read([]),
search_read without fields, e.g. from an API client) raised "The fields
..., which you are trying to read, are not available for employee public
profiles". Restrict them to HR officers, as core does for such fields.

Assisted-by: Claude Opus 5.5
…sers

The fields this module adds on hr.employee are not on hr.employee.public
and had no groups. Users without HR rights read employees through
hr.employee.public, so a read of all the fields of an employee (read([]),
search_read without fields, e.g. from an API client) raised "The fields
..., which you are trying to read, are not available for employee public
profiles". Restrict them to HR officers, as core does for such fields.

Assisted-by: Claude Opus 5.5
@parabol123654
parabol123654 force-pushed the 18.0-fix-hr-employee-fields-groups branch from c4abd32 to 4963f5f Compare November 14, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_employee_language Module hr_employee_language mod:hr_employee_medical_examination Module hr_employee_medical_examination mod:hr_employee_relative Module hr_employee_relative mod:hr_employee_service_contract Module hr_employee_service_contract mod:hr_employee_service Module hr_employee_service mod:hr_personal_equipment_request Module hr_personal_equipment_request series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants