fix(attendance): fetch employee name (#17857)

This commit is contained in:
Mangesh-Khairnar 2019-06-05 20:24:15 +05:30 committed by Nabin Hait
parent 448af7bd46
commit 2bd211cc05
2 changed files with 2 additions and 4 deletions

View File

@ -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",

View File

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