odoo/odoo#203253

Created by Fun Services, Xavier Bol (xbo)
Merged at 0c36065c66829cc34816906e39e9b6979e298dad

Statuses:

Linked pull requests
label
odoo-dev:18.0-attendance-fix-xbo
head
7ee3b2760fc08210336d401b56689e5a6254d668
merged
7 months ago by Misc, Yannick Tivisse (yti)
odoo/odoo odoo/enterprise
18.0 #203253 #82068
saas-18.1 #203358 #82125
saas-18.2 #203616 #82273
saas-18.3
saas-18.4
19.0
master #203618 #82276

[FIX] resource,hr: fix some issues with flexible resources/employees

[FIX] resource: make sure flexible resource don't use attendances

This commit makes sure the resource calendar attendance is not used for
a flexible resource even if that resource has a working schedule
with hours per day equals to 0 hour.

[FIX] hr: recompute is_flexible when working schedule becomes flexible

Before this commit, when the user sets a working schedule to an employee
and convert that working schedule into a flexible working schedule, the
employee is not considered as working with flexible hours.

This commit makes sure the _compute_is_flexible method defined in
hr.employee model is triggered when the flexible_hours field of the
working schedule linked to the employee is altered.

Steps to reproduce the issue:

  1. Install Attendance app (hr_attendance module).
  2. Set a working schedule A to employee E
  3. Go to the form view of the working schedule A and check Flexible Hours field to convert the working schedule as flexible working
    schedule.
  4. Go to Attendance app

Expected Behavior:

The Attendance app should loaded without any issue.

Current Behavior:

A traceback is occurred saying we have a division by zero.

opw-4492625