Skip to content

Commit 683d987

Browse files
Mangesh-Khairnarnabinhait
authored andcommitted
fix(bom): escape name with wildcard character (frappe#18163)
1 parent 37d0c75 commit 683d987

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

erpnext/controllers/queries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ def bom(doctype, txt, searchfield, start, page_len, filters):
206206
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
207207
idx desc, name
208208
limit %(start)s, %(page_len)s """.format(
209-
fcond=get_filters_cond(doctype, filters, conditions),
209+
fcond=get_filters_cond(doctype, filters, conditions).replace('%', '%%'),
210210
mcond=get_match_cond(doctype),
211211
key=frappe.db.escape(searchfield)),
212212
{
213-
'txt': "%%%s%%" % frappe.db.escape(txt),
213+
'txt': "%"+frappe.db.escape(txt)+"%",
214214
'_txt': txt.replace("%", ""),
215215
'start': start or 0,
216216
'page_len': page_len or 20

0 commit comments

Comments
 (0)