odoo/odoo#203618

Created by fw-bot
Merged at 0b966455313090a8cfcc65ec1c9ade5ce3159c0e

Statuses:

Linked pull requests
label
odoo-dev:master-18.0-attendance-fix-xbo-425835-fw
head
f53ff009537f166765b4bb77ee7d6ba7796f1107
merged
7 months ago by Fun Services, Xavier Bol (xbo)
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

[FW][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

Forward-Port-Of: #203358
Forward-Port-Of: #203253