From ce00f6cf701046162bbd3ec499efb29cf5460a1b Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Fri, 24 Jan 2020 16:14:50 +0530 Subject: [PATCH] fix: Duplicate Attendance Due Wrong Date format (#20390) --- erpnext/hr/doctype/attendance/attendance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index c32ccb58cd..c3fbed599b 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -14,7 +14,7 @@ class Attendance(Document): def validate_duplicate_record(self): res = frappe.db.sql("""select name from `tabAttendance` where employee = %s and attendance_date = %s and name != %s and docstatus != 2""", - (self.employee, self.attendance_date, self.name)) + (self.employee, getdate(self.attendance_date), self.name)) if res: frappe.throw(_("Attendance for employee {0} is already marked").format(self.employee))