Skip to content

Commit

Permalink
Merge pull request #86 from kmee/fix/immediate_recurring_application
Browse files Browse the repository at this point in the history
[FIX] Creation of immediate recurring application
  • Loading branch information
mileo authored Dec 18, 2024
2 parents e97ad38 + 9e32be6 commit bd76829
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hr_holidays_allocation_plan/models/hr_leave_allocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"""
Expand Down

0 comments on commit bd76829

Please sign in to comment.