Skip to content

Commit

Permalink
[FIX] hr_holidays: fix accrual for allocation leave
Browse files Browse the repository at this point in the history
In the refactoring of hr_holidays in odoo/odoo@cf33b80aca81, there was a typo
in the loop, with the recordset self instead of the record allocation.

Fixes odoo#164259

closes odoo#164414

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
  • Loading branch information
vava-odoo committed May 6, 2024
1 parent 434a19d commit 61e70a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/hr_holidays/models/hr_leave_allocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def _process_accrual_plans(self, date_to=False, force_period=False, log=True):
# even if the value doesn't change. This is the best performance atm.
first_level = level_ids[0]
first_level_start_date = allocation.date_from + get_timedelta(first_level.start_count, first_level.start_type)
leaves_taken = allocation.leaves_taken if first_level.added_value_type == "day" else allocation.leaves_taken / (self.employee_id.sudo().resource_id.calendar_id.hours_per_day or HOURS_PER_DAY)
leaves_taken = allocation.leaves_taken if first_level.added_value_type == "day" else allocation.leaves_taken / (allocation.employee_id.sudo().resource_id.calendar_id.hours_per_day or HOURS_PER_DAY)
# first time the plan is run, initialize nextcall and take carryover / level transition into account
if not allocation.nextcall:
# Accrual plan is not configured properly or has not started
Expand Down

0 comments on commit 61e70a7

Please sign in to comment.