From 2bd211cc05f2d98323838e234546c335e557c5aa Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Wed, 5 Jun 2019 20:24:15 +0530 Subject: [PATCH] fix(attendance): fetch employee name (#17857) --- erpnext/hr/doctype/attendance/attendance.json | 3 ++- erpnext/hr/doctype/attendance/attendance.py | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/attendance/attendance.json b/erpnext/hr/doctype/attendance/attendance.json index 2459b7a6df0..517fcd7ad72 100644 --- a/erpnext/hr/doctype/attendance/attendance.json +++ b/erpnext/hr/doctype/attendance/attendance.json @@ -122,6 +122,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_from": "employee.employee_name", "fieldname": "employee_name", "fieldtype": "Read Only", "hidden": 0, @@ -461,7 +462,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-03-08 12:00:14.043535", + "modified": "2019-06-05 12:00:14.043535", "modified_by": "Administrator", "module": "HR", "name": "Attendance", diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index 7dd9f0e10c6..321fca71557 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -7,7 +7,6 @@ import frappe from frappe.utils import getdate, nowdate from frappe import _ from frappe.model.document import Document -from erpnext.hr.utils import set_employee_name from frappe.utils import cstr class Attendance(Document): @@ -18,8 +17,6 @@ class Attendance(Document): if res: frappe.throw(_("Attendance for employee {0} is already marked").format(self.employee)) - set_employee_name(self) - def check_leave_record(self): leave_record = frappe.db.sql("""select leave_type, half_day, half_day_date from `tabLeave Application` where employee = %s and %s between from_date and to_date and status = 'Approved'