Thursday, October 21, 2021
4 changes · master
Resolved issues and error corrections
Fixed an issue where employee shifts could default to a full day when the scheduler and employee were in different time zones. Default shift hours are now based on the employee's work schedule, helping avoid incorrect overnight or overly long shifts.
Original PR description
Description of the issue/feature this PR addresses: The search range for the closest work time is not assigned any value if the start date is different than the end date. The dates can be different…
Description of the issue/feature this PR addresses: The search range for the closest work time is not assigned any value if the start date is different than the end date. The dates can be different if the employee is in another timezone. Current behavior before PR: If the browser time is UTC+2 and a shift of an employee in UTC+6 is scheduled, the start time in UTC time will be 01/01/2000 22:00 and the end time will be 02/01/2000 21:59:59. Converted to the resource.tz timezone, the start date will become 02/01/2000 and the end date will be 03/01/2000. Due to the date difference, the search range is not assigned a value, the start of the shift will be at the employee start time on 02/01/2000 and the end of the shift will be around lunch break one day later. Desired behavior after PR is merged: The shift of the employee for a certain day doesn't span over two days or exceeds the hours per day for the employee Related to https://github.com/odoo/enterprise/pull/20428 Task-2628876 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix prevents employee shifts from accidentally stretching across two days when browser and employee time zones differ. It helps ensure planned work hours match the employee's daily schedule and avoids incorrect shift lengths around time zone conversions.
Original PR description
Description of the issue/feature this PR addresses: The search range for the closest work time is not assigned any value if the start date is different than the end date. The dates can be different…
Description of the issue/feature this PR addresses: The search range for the closest work time is not assigned any value if the start date is different than the end date. The dates can be different if the employee is in another timezone. Current behavior before PR: If the browser time is UTC+2 and a shift of an employee in UTC+6 is scheduled, the start time in UTC time will be 01/01/2000 22:00 and the end time will be 02/01/2000 21:59:59. Converted to the resource.tz timezone, the start date will become 02/01/2000 and the end date will be 03/01/2000. Due to the date difference, the search range is not assigned a value, the start of the shift will be at the employee start time on 02/01/2000 and the end of the shift will be around lunch break one day later. Desired behavior after PR is merged: The shift of the employee for a certain day doesn't span over two days or exceeds the hours per day for the employee Related to odoo/enterprise#20428 Task-2628876 ref #75527 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fixes shift planning so default start and end times come from the employee's working schedule, even when they are on leave or in a different timezone. It prevents shifts from incorrectly defaulting to all-day hours, making schedules more accurate for planners and employees.
Original PR description
Description of the issue/feature this PR addresses: In planning, version 14.0: - Create a shift for the employees that are on time off and on the day they are on leave - Create a shift for the employees on a different timezone from the working hours The default hours are 00:00 - 23:59, the default hours should be based on the employee's resource calendar Current behavior before PR: If the user is in a different timezone of if the employee is on leave on the day of the shift, the work interval is not found and defaulted to 00:00 - 23:59 Desired behavior after PR is merged: The default hours for the shift should be based on the employee's resource calendar task-2632775 ref https://github.com/odoo/enterprise/pull/20428
Planning shifts for employees without linked user accounts now default to the employee's own work schedule instead of filling the entire day. This prevents incorrect 00:00-23:59 shifts when users and employees are in different time zones, improving planning accuracy.
Original PR description
Steps to reproduce: https://drive.google.com/file/d/1MngJC_OF-6hsygRKJrbmRohyDXaLd6oD/view create a shift for an employee that isn't linked to a user Observed behavior: the default hours are 00:00 -…
Steps to reproduce: https://drive.google.com/file/d/1MngJC_OF-6hsygRKJrbmRohyDXaLd6oD/view create a shift for an employee that isn't linked to a user Observed behavior: the default hours are 00:00 - 23:59 Expected behavior: the default hours should be based on the employee's resource calendar The issue appeared when the timezone of the user was changed. There was a condition in planning/models/planning.py that was checking the employee's schedule only when the user's timezone was equal to the the employee timezone. This condition has been removed. The default hours of employees are now computed based on the employee's schedule. The existing test in planning/tests/test_form.py has been rewritten: - The slot is created by a user in the Europe/Brussels timezone for an employee in India/Calcutta having a 38 hours per week schedule - The slot is planned for one day between 00:00 and 23:59 - Once the slot is created, the start and end hours of the slot are checked against the employees' schedule on the specific day of the week Task-2628876