Tuesday, May 3, 2022
2 changes
Resolved issues and error corrections
Planning shifts now update more efficiently when employee leave is created, changed, or removed. This reduces delays during leave validation by avoiding unnecessary recalculations and dramatically lowering the amount of database work required.
Original PR description
Before this commit, the shifts are recomputed when a leave is added in the planned dates of those shifts and the compute of working_days_count is too costly. This method slows down the validation of a leave or the creation/suppression of a leave too. This commit improves the performance of this compute to take less time as possible to recompute the working_days_count field of those shifts impacted by a changes on a leave in their planned dates. Also, this commit checks the `vals` when a leave is updated to only recompute the `working_days_count` and the `allocated_hours` fields of shifts when the `resource_id`, `start_datetime` and `end_datetime` fields are changed. Without the fix, the query counter is equal to 395 queries for `_recompute_shifts_in_leave_periods` method and with the fix, only 5 queries are counted. Related PR: #24619
This update improves day-to-day usability across field service-related workflows by setting new helpdesk tickets to low priority by default, improving placement of the lot/serial number button, and keeping planning sample data visible when switching views. It also makes grouped timesheet grids more consistent by showing empty rows where expected.
Original PR description
* helpdesk, industry_fsm_stock, planning In helpdesk, - set low priority as default on ticket creation time - removed fa-pencil icon when sample data is enable In industry_fsm_stock, - aligned lot/SN button to bottom right corner In planning, - fixed sample data visibility on switch view task-2720976 closes: https://github.com/odoo/enterprise/pull/23884