From 559405010437ff4fbee6d72c33bf265910551810 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Mon, 2 Jan 2017 11:14:44 +0530 Subject: [PATCH] [Fix] Attendance validation in Leave Application --- erpnext/hr/doctype/leave_application/leave_application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 5c836df8c9b..fbf86e178b6 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -217,7 +217,7 @@ class LeaveApplication(Document): def validate_attendance(self): attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s and (att_date between %s and %s) - and docstatus = 1""", + and status = "Present" and docstatus = 1""", (self.employee, self.from_date, self.to_date)) if attendance: frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee),