From 39b4b9400147c591ed0e7bb61ca438142eab4e6b Mon Sep 17 00:00:00 2001 From: krantheman Date: Mon, 22 Jan 2024 16:44:52 +0530 Subject: [PATCH] fix(Shift Attendance): conversion of datetime to time for same date for None values --- hrms/hr/report/shift_attendance/shift_attendance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hrms/hr/report/shift_attendance/shift_attendance.py b/hrms/hr/report/shift_attendance/shift_attendance.py index 479a6b73b0..3263747647 100644 --- a/hrms/hr/report/shift_attendance/shift_attendance.py +++ b/hrms/hr/report/shift_attendance/shift_attendance.py @@ -288,13 +288,13 @@ def format_in_out_time(in_time, out_time, attendance_date): in_time = in_time.time() elif out_time and not in_time and out_time.date() == attendance_date: out_time = out_time.time() - elif in_time and out_time: + else: in_time, out_time = convert_datetime_to_time_for_same_date(in_time, out_time) return in_time, out_time def convert_datetime_to_time_for_same_date(start, end): - if start.date() == end.date(): + if start and end and start.date() == end.date(): start = start.time() end = end.time() else: