Saturday, May 11, 2024
2 changes · saas-17.1
Miscellaneous changes
To reproduce: ============= - Create a 24-hour calendar representing a company without breaks. - Create an employee who will be working a night shift 21:30 to 6:00 - Create an open shift from 21:30 to 6:00. - as the company doesn't have breaks the shift will have 8 hours and 30 minutes of allocated hours. Set the allocated hours to 8 hours - click auto-plan -> the employee is assigned to the shift but the allocated hours are changed to 7 hours and 32 minutes. Problem: ======== -
Original PR description
To reproduce: ============= - Create a 24-hour calendar representing a company without breaks. - Create an employee who will be working a night shift 21:30 to 6:00 - Create an open shift from 21:30…
To reproduce:
=============
- Create a 24-hour calendar representing a company without breaks.
- Create an employee who will be working a night shift 21:30 to 6:00
- Create an open shift from 21:30 to 6:00.
- as the company doesn't have breaks the shift will have 8 hours and 30 minutes of allocated hours. Set the allocated hours to 8 hours
- click auto-plan -> the employee is assigned to the shift but the allocated hours are changed
to 7 hours and 32 minutes.
Problem:
========
- when setting the allocated hours to 8 hours, the allocated percentage changed to 94%.
- after auto-planning, and setting the resource to the shift, the allocated hours are recomputed based on the allocated percentage and the working hours of the resource which is 8 * 0.94 = 7.52 hours.
Solution:
=========
after finding the resource to assign to the shift, we should recomputed the allocated percentage based on the working calendar of the resource and the allocated hours set on the shift.
opw-3874283
Forward-Port-Of: odoo/enterprise#62264This traceback occurs when the user makes the `end date` as empty while creating a new planning slot with template. To reproduce this issue: 1) Install planning 2) Create a new `planning slot` 3) click on any `template id` 4) Now remove the `end date` 5) A traceback occurs Error:- ``` TypeError: unsupported operand type(s) for -: 'bool' and 'datetime.datetime' ``` When the user removes the `end datetime` its value is `False` which leads to the above traceback when `-` is u
Original PR description
This traceback occurs when the user makes the `end date` as empty while creating a new planning slot with template. To reproduce this issue: 1) Install planning 2) Create a new `planning slot` 3)…
This traceback occurs when the user makes the `end date` as empty while creating a new planning slot with template. To reproduce this issue: 1) Install planning 2) Create a new `planning slot` 3) click on any `template id` 4) Now remove the `end date` 5) A traceback occurs Error:- ``` TypeError: unsupported operand type(s) for -: 'bool' and 'datetime.datetime' ``` When the user removes the `end datetime` its value is `False` which leads to the above traceback when `-` is used between `start` and `end` datetime. https://github.com/odoo/enterprise/blob/5600b5b754f79e5d7a253fe9db45ac8a9273d3de/planning/models/planning.py#L406-L408 Additionally, a `value error` is also occurring when the `start` date-time is empty, while calculating start-end-dates with `template` . As it returns both `datetime` and timezone. From the below lines `tzinfo` only removes when the start date time and template is present. https://github.com/odoo/enterprise/blob/5600b5b754f79e5d7a253fe9db45ac8a9273d3de/planning/models/planning.py#L621-L627 After applying this commit will resolve both issues and make the code more robust sentry-5005245970 Forward-Port-Of: odoo/enterprise#61024