Skip to content

Commit

Permalink
Merge PR #1440 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 5, 2025
2 parents 0314f33 + 80d2bd1 commit 68fb258
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hr_employee_calendar_planning/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ def post_init_hook(env, employees=None):
)
# Extract employee's existing leaves so they are passed to the new
# automatic calendar.
leaves = employee.resource_calendar_id.leave_ids.filtered(
lambda x, e=employee: x.resource_id == e.resource_id
)
employee.calendar_ids = calendar_lines
employee.resource_calendar_id.active = False
# Now the automatic calendar has been created, so we link the
# leaves to that one so they count correctly.
leaves = employee.resource_calendar_id.leave_ids.filtered(
lambda x, e=employee: x.resource_id == e.resource_id
)
leaves.write({"calendar_id": employee.resource_calendar_id.id})

0 comments on commit 68fb258

Please sign in to comment.