Merge pull request #5901 from bcornwellmott/fix_employee_lookup
Fix Timesheet employee query to show names
diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py
index 895ace3..a1b757c 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.py
+++ b/erpnext/projects/doctype/timesheet/timesheet.py
@@ -293,7 +293,7 @@
@frappe.whitelist()
def get_employee_list(doctype, txt, searchfield, start, page_len, filters):
- return frappe.db.sql("""select distinct(employee) as employee
+ return frappe.db.sql("""select distinct employee, employee_name
from `tabSalary Structure` where salary_slip_based_on_timesheet=1
- and employee like %(txt)s limit %(start)s, %(page_len)s""",
- {'txt': "%%%s%%"%(txt), 'start': start, 'page_len': page_len})
+ and employee like %(txt)s or employee_name like %(txt)s limit %(start)s, %(page_len)s""",
+ {'txt': "%%%s%%"% txt, 'start': start, 'page_len': page_len})