-
Couldn't load subscription status.
- Fork 30.2k
[FW][FIX] resource,hr: fix some issues with flexible resources/employees #203358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FW][FIX] resource,hr: fix some issues with flexible resources/employees #203358
Conversation
|
@xavierbol @tivisse cherrypicking of pull request #203253 failed. stdout: Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?). In the former case, you may want to edit this PR message as well. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
|
Hello @xavierbol Feel free to solve the conflict when you got some time. Thanks :) |
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: ----------------------------- 0. Install Attendance app (`hr_attendance` module). 1. Set a working schedule A to employee E 2. Go to the form view of the working schedule A and check `Flexible Hours` field to convert the working schedule as flexible working schedule. 3. 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
fa7465c to
0069091
Compare
|
The first commit has been moved in #202849 to merge as quicker as possible the second commit which is more important for the customers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robodoo r+
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: ----------------------------- 0. Install Attendance app (`hr_attendance` module). 1. Set a working schedule A to employee E 2. Go to the form view of the working schedule A and check `Flexible Hours` field to convert the working schedule as flexible working schedule. 3. 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 closes #203358 Related: odoo/enterprise#82125 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com> Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>

[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.
Remark: this fix has been moved in #202849
[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_flexiblemethod defined inhr.employeemodel is triggered when theflexible_hoursfield of theworking schedule linked to the employee is altered.
Steps to reproduce the issue:
hr_attendancemodule).Flexible Hoursfield to convert the working schedule as flexible workingschedule.
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: #203253