Skip to content

[FIX] hr_holidays_public: fix singleton error and skip archived users in _compute_im_status - #266

Open
Camille0907 wants to merge 1 commit into
OCA:17.0from
camptocamp:17.0-fix-hr_holidays_public
Open

[FIX] hr_holidays_public: fix singleton error and skip archived users in _compute_im_status#266
Camille0907 wants to merge 1 commit into
OCA:17.0from
camptocamp:17.0-fix-hr_holidays_public

Conversation

@Camille0907

Copy link
Copy Markdown

_compute_im_status was calling .is_public_holiday directly on user_ids.employee_id, a potentially multi-record set when a partner has several users, causing:

    ValueError: Expected singleton: hr.employee(X, Y)

Fix by using .filtered("is_public_holiday") instead, and call _get_im_status_hr_holidays_public on the model to avoid any further recordset assumption.

Also add with_context(active_test=True) to ensure archived users are excluded from the public holiday check.

Add a test covering:

  • partner with multiple active users (one employee on holiday)
  • archived user's holiday is correctly ignored after archiving

…sers in `_compute_im_status`

`_compute_im_status` was calling `.is_public_holiday` directly on
`user_ids.employee_id`, a potentially multi-record set when a partner
has several users, causing:
```
    ValueError: Expected singleton: hr.employee(X, Y)
```
Fix by using `.filtered("is_public_holiday")` instead, and call
`_get_im_status_hr_holidays_public` on the model to avoid any further
recordset assumption.

Also add `with_context(active_test=True)` to ensure archived users
are excluded from the public holiday check.

Add a test covering:
- partner with multiple active users (one employee on holiday)
- archived user's holiday is correctly ignored after archiving
@OCA-git-bot OCA-git-bot added series:17.0 mod:hr_holidays_public Module hr_holidays_public labels Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_holidays_public Module hr_holidays_public series:17.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants