Skip to content

[15.0][FIX] hr_timesheet_sheet_attendance: Fix timezone handling when linking attendances#889

Open
AaronHForgeFlow wants to merge 1 commit into
OCA:15.0from
ForgeFlow:15.0-fix-hr_timesheet_attendance-link-timesheet-tz
Open

[15.0][FIX] hr_timesheet_sheet_attendance: Fix timezone handling when linking attendances#889
AaronHForgeFlow wants to merge 1 commit into
OCA:15.0from
ForgeFlow:15.0-fix-hr_timesheet_attendance-link-timesheet-tz

Conversation

@AaronHForgeFlow

Copy link
Copy Markdown

A fix was proposed in #845 but this one goes more straight to the point IMHO.

Root cause: The retroactive linking in HrTimesheetSheet.create() compared the UTC-stored check_in datetime against bare dates using midnight UTC as boundary. For UTC-negative timezones, any check-in on
date_end (e.g. 17:57 UTC) fails check_in <= date_end 00:00 UTC.

Steps to reproduce:

  1. Create an employee with timezone set to a UTC-negative timezone (e.g. America/New_York)
  2. Create an attendance for that employee with check_in on the last day of the intended sheet period (e.g. Sunday), at any normal working hour
  3. Create a timesheet sheet covering that period after the attendance was created
  4. Observe that the attendance is not linked to the sheet (sheet_id is empty)

@AaronHForgeFlow AaronHForgeFlow changed the title [15.0][FIX] hr_timesheet_sheet_attendance: Fix timezone handling when linking attendanes [15.0][FIX] hr_timesheet_sheet_attendance: Fix timezone handling when linking attendances Mar 25, 2026
@AaronHForgeFlow

Copy link
Copy Markdown
Author

pre-commit will be fix after this being merged: #890

@AaronHForgeFlow AaronHForgeFlow force-pushed the 15.0-fix-hr_timesheet_attendance-link-timesheet-tz branch from 41186e7 to 1931286 Compare March 25, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant