Skip to content

Commit

Permalink
fix: consider curr_shift to retrieve prev_shift when possible
Browse files Browse the repository at this point in the history
(cherry picked from commit 3446515)
  • Loading branch information
sagarvora authored and mergify[bot] committed May 30, 2023
1 parent 8da0656 commit a4889b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hrms/hr/doctype/shift_assignment/shift_assignment.py
Expand Up @@ -362,7 +362,10 @@ def get_employee_shift_timings(
employee, curr_shift.start_datetime + timedelta(days=1), consider_default_shift, "forward"
)
prev_shift = get_employee_shift(
employee, for_timestamp + timedelta(days=-1), consider_default_shift, "reverse"
employee,
(curr_shift.end_datetime if curr_shift else for_timestamp) + timedelta(days=-1),
consider_default_shift,
"reverse",
)

if curr_shift:
Expand Down

0 comments on commit a4889b0

Please sign in to comment.