fix: don't show blocked supplier in autocomplete

This commit is contained in:
Ankush Menat 2021-10-27 19:15:44 +05:30 committed by Ankush Menat
parent 5902762ec8
commit 2221c9ed89

View File

@ -132,7 +132,8 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select {field} from `tabSupplier`
where docstatus < 2
and ({key} like %(txt)s
or supplier_name like %(txt)s) and disabled=0
or supplier_name like %(txt)s) and disabled=0
and (on_hold = 0 or (on_hold = 1 and CURDATE() > release_date))
{mcond}
order by
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),