fix: skip validation for overlapping shift attendance if no shift is linked

This commit is contained in:
Rucha Mahabal 2022-04-04 11:14:40 +05:30
parent 62cdde9a84
commit 1d4b1c42f2
2 changed files with 4 additions and 1 deletions

View File

@ -166,6 +166,9 @@ def get_duplicate_attendance_record(employee, attendance_date, shift, name=None)
def get_overlapping_shift_attendance(employee, attendance_date, shift, name=None):
if not shift:
return {}
attendance = frappe.qb.DocType("Attendance")
query = (
frappe.qb.from_(attendance)

View File

@ -116,7 +116,7 @@ class TestAttendance(FrappeTestCase):
shift_2 = setup_shift_type(shift_type="Shift 2", start_time="11:00:00", end_time="12:00:00")
mark_attendance(employee, date, "Present", shift_1.name)
attendance = frappe.get_doc(
frappe.get_doc(
{
"doctype": "Attendance",
"employee": employee,