From 9e32be655663dc985b08928d05c2bcf63810ef58 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Wed, 18 Dec 2024 14:18:54 -0300 Subject: [PATCH] [FIX] Creation of immediate recurring application --- hr_holidays_allocation_plan/models/hr_leave_allocation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hr_holidays_allocation_plan/models/hr_leave_allocation.py b/hr_holidays_allocation_plan/models/hr_leave_allocation.py index f386e15..6138053 100644 --- a/hr_holidays_allocation_plan/models/hr_leave_allocation.py +++ b/hr_holidays_allocation_plan/models/hr_leave_allocation.py @@ -252,7 +252,7 @@ class HrLeaveAllocationPlan(models.Model): def action_recompute_plan(self): for record in self: employees = self.env["hr.employee"] - + if record.date_to and record.date_to < fields.Date.today(): record.state = "cancel" continue @@ -303,7 +303,7 @@ def _create_recurrent(self, employee, running_contracts): while current_date < fields.Date.today(): - if self.immediate_allocation and not jump: + if not self.immediate_allocation and not jump: current_date += relativedelta(years=self.recurring_renewal_frequency) jump = True @@ -337,8 +337,8 @@ def _create_recurrent(self, employee, running_contracts): ) allocation.action_validate() - # Increment to the next year after the first allocation - current_date += relativedelta(years=1) + # Increment to the next year after the first allocation + current_date += relativedelta(years=1) def _create_regular(self): """Aloca somente uma vez de forma fixa"""