From 613919325de329d33e65ca5867eaa7ae51227d2b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 30 Apr 2014 20:30:33 +0530 Subject: [PATCH] Fixes in link field queries --- erpnext/controllers/queries.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index b876a2b502..4547276f28 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -37,7 +37,7 @@ def employee_query(doctype, txt, searchfield, start, page_len, filters): %(mcond)s order by if(locate("%(_txt)s", name), locate("%(_txt)s", name), 99999), - if(locate("%(_txt)s", employee_name), locate("%(_txt)s", item_name), 99999), + if(locate("%(_txt)s", employee_name), locate("%(_txt)s", employee_name), 99999), name, employee_name limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt, '_txt': txt.replace("%", ""), @@ -54,8 +54,8 @@ def lead_query(doctype, txt, searchfield, start, page_len, filters): %(mcond)s order by if(locate("%(_txt)s", name), locate("%(_txt)s", name), 99999), - if(locate("%(_txt)s", lead_name), locate("%(_txt)s", name), 99999), - if(locate("%(_txt)s", company_name), locate("%(_txt)s", name), 99999), + if(locate("%(_txt)s", lead_name), locate("%(_txt)s", lead_name), 99999), + if(locate("%(_txt)s", company_name), locate("%(_txt)s", company_name), 99999), name, lead_name limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt, '_txt': txt.replace("%", ""), @@ -79,7 +79,7 @@ def customer_query(doctype, txt, searchfield, start, page_len, filters): %(mcond)s order by if(locate("%(_txt)s", name), locate("%(_txt)s", name), 99999), - if(locate("%(_txt)s", customer_name), locate("%(_txt)s", name), 99999), + if(locate("%(_txt)s", customer_name), locate("%(_txt)s", customer_name), 99999), name, customer_name limit %(start)s, %(page_len)s""" % {'field': fields,'key': searchfield, 'txt': "%%%s%%" % txt, '_txt': txt.replace("%", ""), @@ -102,7 +102,7 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters): %(mcond)s order by if(locate("%(_txt)s", name), locate("%(_txt)s", name), 99999), - if(locate("%(_txt)s", supplier_name), locate("%(_txt)s", name), 99999), + if(locate("%(_txt)s", supplier_name), locate("%(_txt)s", supplier_name), 99999), name, supplier_name limit %(start)s, %(page_len)s """ % {'field': fields,'key': searchfield, 'txt': "%%%s%%" % txt, '_txt': txt.replace("%", ""),