Files
odoo_source/addons/resource
Abderraouf Ghrissi (abgh) 9ac153c7aa [FIX] hr_{,holidays}_attendance, resource: overtime is wrong for multi companies
Steps to Reproduce:

Create 2 companies > Create employee in 1st company > Enable both companies > Create public holidays company-wise> In company 1 create a public holiday for (13/11/2023) > In company 2 create public holidays (13/11/2023) and (29/11/2023).

Then switch to the one company (where the public holiday was created only for (13/11/2023))> Go to attendance > Configuration > Enable the count extra hours feature > Create attendance date (29/11/2023) for ex. 9 hours > Go to employee form > You may see the extra hour of "1 hour" > Because there is no public holiday on 29/11/2023.

Then enable both companies > Create attendance date (29/11/2023) for ex. 9 hours > Go to employee form > You may see the extra hours of "9 hours" > Because there is a public holiday in another company on 29/11/2023.

Bug Source:
commit 1407052 fixed the fact that public holidays are not taken into account when computing the overtime, but it doesn't cover the multi companies case.

Solution:
Verify that the public holiday company and the employee company are the same before applying the compute.
An optimization was also added to avoid searching for public holidays in db by filtering with the
employee company.

opw-3597287

closes odoo/odoo#146987

X-original-commit: 62494f5c7c80f2fafa56e397f2cd918e1a9e2648
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-21 21:53:44 +00:00
..
…