odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[FIX] hr_holidays : Use employee resource for computation of allocation

Open yoba-odoo opened this issue 1 year ago • 3 comments

Steps to reproduce:

- Create a new working schedule that is not 8 hours a day
- Assign this working schedule to one of the employees
- Create a Time off type and set the unit as 'Hours'
- Create an allocation for the created type and the employee with the new working schedule
- Set the Allocation for 80 hours and save
- Notice the 80 has been changed

Current behavior before PR:

This is happening because in this commit https://github.com/odoo-dev/odoo/commit/1d8898bae93da9ccc1687971a19b238f279032eb we changed the computation of the allocation to use HOURS_PER_DAY which is a static variable set to 8 -default working hours per day- so if the employee has different working hours a day it will be calculated wrongly.

Desired behavior after PR is merged:

We are now using the working hours for the resource of the employee and we only fallback on HOURS_PER_DAY if there isn't a resource for the employee.

opw-4224592

yoba-odoo avatar Oct 10 '24 15:10 yoba-odoo

Pull request status dashboard

robodoo avatar Oct 10 '24 15:10 robodoo

@robodoo fw=no

got resolved in later versions by https://github.com/odoo-dev/odoo/commit/85d9fbf0429d15831cf4b56ca2a0fb04badddb94

yoba-odoo avatar Oct 10 '24 15:10 yoba-odoo

Disabled forward-porting.

robodoo avatar Oct 10 '24 15:10 robodoo

fixed in this commit https://github.com/odoo/odoo/pull/180630/commits/53b053b0b13dd9a9883298dd07365344b6869e1a

yoba-odoo avatar Oct 17 '24 11:10 yoba-odoo