diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-02-20 14:03:55 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-02-21 15:28:49 +0100 |
| commit | 73bd7ef0e0889b109d679a2465e4f1f0d7acaa3e (patch) | |
| tree | c690aa85cbac274b58c3b25612bad128c558a65c /setup | |
| parent | 534c9e9c15bfed7654f69bc771b60542dd9ab56d (diff) | |
[FIX] hr_payroll: calculation of work days
The current calculation of work days is inconsistent with the leaves of
the employee in several cases.
The core of the problem is the logic of the algorithm: for a given day,
if we can find one hr_holiday within this day, we consider it as a
leave. One can easily spot several issues with the existing logic:
- if an employee takes less than a day-off (e.g. a half day), the
complete day is considered as a leave.
- the timezone (TZ) is not taken into account when searching for a
leave, while it is when computing the number of working hours. A leave
from 3:00 AM to 3:00 PM in the Los Angeles timezone would then be
considered as two days-off since it spread on two days in UTC.
The logic is therefore completely modified. For each day of the period:
- compute the work intervals (TZ taken into account, converted in UTC)
- search for a hr.holiday which completely includes the work interval
- if a holiday is found, the work interval is considered as a leave.
Otherwise, it is considered as a normal work period.
This is a first step in improving the logic. The first faulty use case
is partially solved, since we cover now complete work intervals.
However, a leave covering only partially a work interval will not be
taken into account.
The second faulty use case is solved.
opw-707897
Diffstat (limited to 'setup')
0 files changed, 0 insertions, 0 deletions
