[18.0][FIX] hr_shift: current_shift_id must be the shift active right now - #44
Merged
OCA-git-bot merged 1 commit intoAug 24, 2026
Merged
Conversation
victoralmau
suggested changes
Aug 14, 2026
cvinh
force-pushed
the
18.0-fix_hr_shift_employee_current_shift
branch
from
August 21, 2026 09:13
f1877c2 to
84d527c
Compare
victoralmau
suggested changes
Aug 24, 2026
The compute filled current_shift_id with any shift scheduled today using a UTC-day window. In non-UTC timezones (GMT-10), the day boundary splits across two UTC days and same-day shifts can raise a SingletonError on the Many2one assignment. Switch _shift_of_date's domain from containment to overlap and call it with (now, now) so the field matches the shift covering this instant, as its name implies. Night shifts crossing midnight are covered as a side effect. _shift_of_date is kept as a public hook. Assisted-by: Claude Opus 4.7
cvinh
force-pushed
the
18.0-fix_hr_shift_employee_current_shift
branch
from
August 24, 2026 07:37
84d527c to
4724c60
Compare
victoralmau
approved these changes
Aug 24, 2026
Member
|
/ocabot merge patch |
Contributor
|
This PR has the |
Contributor
|
This PR looks fantastic, let's merge it! |
Contributor
|
Congratulations, your PR was merged at c7fe467. Thanks a lot for contributing to OCA. ❤️ |
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.
The compute filled current_shift_id with any shift scheduled today using a UTC-day window. In non-UTC timezones (GMT-10), the day boundary splits across two UTC days and same-day shifts can raise a SingletonError on the Many2one assignment.
Switch _shift_of_date's domain from containment to overlap and call it with (now, now) so the field matches the shift covering this instant, as its name implies. Night shifts crossing midnight are covered as a side effect. _shift_of_date is kept as a public hook.