[get_query]to server side

This commit is contained in:
Saurabh
2013-07-09 16:18:52 +05:30
parent ebe50397d9
commit ab462d2000
52 changed files with 692 additions and 314 deletions

View File

@@ -173,8 +173,8 @@ def bom(doctype, txt, searchfield, start, page_len, filters):
def get_project_name(doctype, txt, searchfield, start, page_len, filters):
cond = ''
if filters['customer']:
cond = '(`tabProject`.customer = filter[customer] or ifnull(`tabProject`.customer,"")="") '
cond = '(`tabProject`.customer = "' + filters['customer'] + '" or ifnull(`tabProject`.customer,"")="") and'
return webnotes.conn.sql("""select `tabProject`.name from `tabProject`
where `tabProject`.status not in ("Completed", "Cancelled") and %(cond)s %(mcond)s
`tabProject`.name like "%(txt)s" order by `tabProject`.name asc limit %(start)s, %(page_len)s """ %
where `tabProject`.status not in ("Completed", "Cancelled") and %(cond)s
`tabProject`.name like "%(txt)s" %(mcond)s order by `tabProject`.name asc limit %(start)s, %(page_len)s """ %
{'cond': cond,'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield),'start': start, 'page_len': page_len})