odoo/odoo#224769

Created by Sara Briki (brsa)
Merged at dfdefa39f665b0e8cd66852eca3610a45d45076f

Statuses:

label
odoo-dev:master-fix_traceback_on_validate_leave_for_fully_flexible_employee-brsa
head
f8bc29b85d76da32d4405df602196044902db9e2
merged
5 days ago by Misc, Yannick Tivisse (yti)
odoo/odoo
master #224769

[FIX] project_timesheet_holidays: skip validation for flexible hours

Steps to Reproduce

  • Go to Time Off > Management > Time Off
  • Create a Time Off for an employee with empty "Working Hours" (Payroll tab on profile).
  • Ensure the Time Off Type has "Requires allocation" unchecked so it appears in the dropdown.
  • Save and then try to Validate.

Issue

During validation, _validate_leave_request assumes the employee has a working calendar and tries to access calendar.tz. When "Working Hours" is empty, resource_calendar_id is False, leading to the traceback.

Fix

Skip timesheet generation and upper bound check when the employee has no working calendar (fully flexible case).

task-5048761