[FIX] hr_holidays: fix invalid first level next call date
Prior to this commit the next call date for the first level would not take the second level into account, as such it could be that the first level would be completely skipped instead of being prorated properly. TaskId-2768435 closes odoo/odoo#84899 X-original-commit: 791b801c7b96a94353031a06dd5da4eeb20ee08b Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com> Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit is contained in:
@@ -411,6 +411,9 @@ class HolidaysAllocation(models.Model):
|
||||
continue
|
||||
allocation.lastcall = max(allocation.lastcall, first_level_start_date)
|
||||
allocation.nextcall = first_level._get_next_date(allocation.lastcall)
|
||||
if len(level_ids) > 1:
|
||||
second_level_start_date = allocation.date_from + get_timedelta(level_ids[1].start_count, level_ids[1].start_type)
|
||||
allocation.nextcall = min(second_level_start_date - relativedelta(days=1), allocation.nextcall)
|
||||
allocation._message_log(body=first_allocation)
|
||||
days_added_per_level = defaultdict(lambda: 0)
|
||||
while allocation.nextcall <= today:
|
||||
|
||||
Reference in New Issue
Block a user