[FIX] hr_holidays_public: fix singleton error and skip archived users in _compute_im_status - #266
Open
Camille0907 wants to merge 1 commit into
Open
[FIX] hr_holidays_public: fix singleton error and skip archived users in _compute_im_status#266Camille0907 wants to merge 1 commit into
hr_holidays_public: fix singleton error and skip archived users in _compute_im_status#266Camille0907 wants to merge 1 commit into
Conversation
…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
jcoux
approved these changes
Jul 20, 2026
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.
_compute_im_statuswas calling.is_public_holidaydirectly onuser_ids.employee_id, a potentially multi-record set when a partner has several users, causing:Fix by using
.filtered("is_public_holiday")instead, and call_get_im_status_hr_holidays_publicon 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: