diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index f6a31a0f7c..b8c1bd6261 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -153,7 +153,7 @@ def gl_entry_details(doctype, txt, searchfield, start, page_len, filters): "dt":filters["dt"], "acc":filters["acc"], "account_type": filters['account_type'], - 'mcond':get_match_cond(doctype, searchfield), + 'mcond':get_match_cond(doctype), 'txt': "%%%s%%" % txt, "start": start, "page_len": page_len diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 6bccd03af3..a24b844aae 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -793,7 +793,7 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters): and tabAccount.company = '%(company)s' and tabAccount.%(key)s LIKE '%(txt)s' %(mcond)s""" % {'company': filters['company'], 'key': searchfield, - 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield)}) + 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype)}) @frappe.whitelist() diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index d5ea23257d..9b68f12e42 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -36,7 +36,7 @@ def employee_query(doctype, txt, searchfield, start, page_len, filters): case when employee_name like "%(txt)s" then 0 else 1 end, name limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt, - 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len}) + 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len}) # searches for leads which are not converted def lead_query(doctype, txt, searchfield, start, page_len, filters): @@ -53,7 +53,7 @@ def lead_query(doctype, txt, searchfield, start, page_len, filters): case when company_name like "%(txt)s" then 0 else 1 end, lead_name asc limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt, - 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len}) + 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len}) # searches for customer def customer_query(doctype, txt, searchfield, start, page_len, filters): @@ -76,7 +76,7 @@ def customer_query(doctype, txt, searchfield, start, page_len, filters): case when customer_name like "%(txt)s" then 0 else 1 end, name, customer_name limit %(start)s, %(page_len)s""" % {'field': fields,'key': searchfield, - 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), + 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len}) # searches for supplier @@ -98,7 +98,7 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters): case when supplier_name like "%(txt)s" then 0 else 1 end, name, supplier_name limit %(start)s, %(page_len)s """ % {'field': fields,'key': searchfield, - 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), 'start': start, + 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len}) def tax_account_query(doctype, txt, searchfield, start, page_len, filters): @@ -134,7 +134,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters): {fcond} {mcond} limit %(start)s, %(page_len)s """.format(key=searchfield, fcond=get_filters_cond(doctype, filters, conditions), - mcond=get_match_cond(doctype, searchfield)), + mcond=get_match_cond(doctype)), { "today": nowdate(), "txt": "%%%s%%" % txt, @@ -153,7 +153,7 @@ def bom(doctype, txt, searchfield, start, page_len, filters): %(fcond)s %(mcond)s limit %(start)s, %(page_len)s """ % {'key': searchfield, 'txt': "%%%s%%" % txt, 'fcond': get_filters_cond(doctype, filters, conditions), - 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len}) + 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len}) def get_project_name(doctype, txt, searchfield, start, page_len, filters): cond = '' @@ -165,7 +165,7 @@ def get_project_name(doctype, txt, searchfield, start, page_len, filters): 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}) + 'mcond':get_match_cond(doctype),'start': start, 'page_len': page_len}) def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, filters): return frappe.db.sql("""select `tabDelivery Note`.name, `tabDelivery Note`.customer_name @@ -202,7 +202,7 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters): order by batch_no desc limit %(start)s, %(page_len)s """ % {'item_code': filters['item_code'], 'warehouse': filters['warehouse'], 'posting_date': filters['posting_date'], - 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), + 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len}) else: return frappe.db.sql("""select name from tabBatch @@ -214,5 +214,5 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters): order by name desc limit %(start)s, %(page_len)s""" % {'item_code': filters['item_code'], 'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt, - 'mcond':get_match_cond(doctype, searchfield),'start': start, + 'mcond':get_match_cond(doctype),'start': start, 'page_len': page_len}) diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 6f0ff927b6..0e7678118f 100644 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -85,5 +85,5 @@ def get_project(doctype, txt, searchfield, start, page_len, filters): %(mcond)s order by name limit %(start)s, %(page_len)s """ % {'key': searchfield, - 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), + 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len}) \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.py b/erpnext/selling/doctype/sales_bom/sales_bom.py index 823b67dcdc..fb4696199c 100644 --- a/erpnext/selling/doctype/sales_bom/sales_bom.py +++ b/erpnext/selling/doctype/sales_bom/sales_bom.py @@ -39,5 +39,5 @@ def get_new_item_code(doctype, txt, searchfield, start, page_len, filters): where is_stock_item="No" and is_sales_item="Yes" and name not in (select name from `tabSales BOM`) and %s like %s %s limit %s, %s""" % (searchfield, "%s", - get_match_cond(doctype, searchfield),"%s", "%s"), + get_match_cond(doctype),"%s", "%s"), ("%%%s%%" % txt, start, page_len)) \ No newline at end of file diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py index 03d6e41ae7..b7b6473203 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -171,5 +171,5 @@ def item_details(doctype, txt, searchfield, start, page_len, filters): and ifnull(qty, 0) > ifnull(packed_qty, 0)) and %s like "%s" %s limit %s, %s """ % ("%s", searchfield, "%s", - get_match_cond(doctype, searchfield), "%s", "%s"), + get_match_cond(doctype), "%s", "%s"), (filters["delivery_note"], "%%%s%%" % txt, start, page_len)) \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 719f7b1aa7..3aeb507873 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -631,7 +631,7 @@ def query_sales_return_doc(doctype, txt, searchfield, start, page_len, filters): or `customer` like %%(txt)s) %s %s order by name, customer, customer_name limit %s""" % (doctype, searchfield, conditions, - get_match_cond(doctype, searchfield), "%(start)s, %(page_len)s"), + get_match_cond(doctype), "%(start)s, %(page_len)s"), {"txt": "%%%s%%" % txt, "start": start, "page_len": page_len}, as_list=True) @@ -641,7 +641,7 @@ def query_purchase_return_doc(doctype, txt, searchfield, start, page_len, filter and (`%s` like %%(txt)s or `supplier` like %%(txt)s) %s order by name, supplier, supplier_name - limit %s""" % (doctype, searchfield, get_match_cond(doctype, searchfield), + limit %s""" % (doctype, searchfield, get_match_cond(doctype), "%(start)s, %(page_len)s"), {"txt": "%%%s%%" % txt, "start": start, "page_len": page_len}, as_list=True) @@ -679,7 +679,7 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters): 's_warehouse': filters['s_warehouse'], 'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt, - 'mcond':get_match_cond(doctype, searchfield), + 'mcond':get_match_cond(doctype), "start": start, "page_len": page_len }