diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 819bbf9d20..cb0484f58f 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -126,7 +126,7 @@ class LeaveApplication(Document): if attendance_name: # update existing attendance, change absent to on leave - doc = frappe.get_doc('Attendance', attendance_date) + doc = frappe.get_doc('Attendance', attendance_name) if doc.status != status: doc.db_set('status', status) doc.db_set('leave_type', self.leave_type)