fix(bom): escape name with wildcard character (#18164)

This commit is contained in:
Mangesh-Khairnar 2019-07-08 10:40:40 +05:30 committed by Nabin Hait
parent 8309fcfbbc
commit 6a7969117f

View File

@ -206,10 +206,11 @@ def bom(doctype, txt, searchfield, start, page_len, filters):
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999), if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
idx desc, name idx desc, name
limit %(start)s, %(page_len)s """.format( limit %(start)s, %(page_len)s """.format(
fcond=get_filters_cond(doctype, filters, conditions), fcond=get_filters_cond(doctype, filters, conditions).replace('%', '%%'),
mcond=get_match_cond(doctype), mcond=get_match_cond(doctype),
key=searchfield), { key=frappe.db.escape(searchfield)),
'txt': '%' + txt + '%', {
'txt': "%"+frappe.db.escape(txt)+"%",
'_txt': txt.replace("%", ""), '_txt': txt.replace("%", ""),
'start': start or 0, 'start': start or 0,
'page_len': page_len or 20 'page_len': page_len or 20