fix: Duplicate Attendance Due Wrong Date format (#20390)

This commit is contained in:
Anurag Mishra 2020-01-24 16:14:50 +05:30 committed by Nabin Hait
parent 0a27c98a99
commit ce00f6cf70

View File

@ -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))