Merge pull request #16207 from Zlash65/fix-qi
[Minor] Make Quality Inspection in query configurable
This commit is contained in:
commit
37d7d25018
@ -61,7 +61,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
if filters.get("from"):
|
||||
from frappe.desk.reportview import get_match_cond
|
||||
mcond = get_match_cond(filters["from"])
|
||||
cond = ""
|
||||
cond, qi_condition = "", "and (quality_inspection is null or quality_inspection = '')"
|
||||
|
||||
if filters.get('from') in ['Purchase Invoice Item', 'Purchase Receipt Item']:
|
||||
cond = """and item_code in (select name from `tabItem` where
|
||||
@ -72,9 +72,13 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
elif filters.get('from') == 'Stock Entry Detail':
|
||||
cond = """and s_warehouse is null"""
|
||||
|
||||
if filters.get('from') in ['Supplier Quotation Item']:
|
||||
qi_condition = ""
|
||||
|
||||
return frappe.db.sql(""" select item_code from `tab{doc}`
|
||||
where parent=%(parent)s and docstatus < 2 and item_code like %(txt)s
|
||||
and (quality_inspection is null or quality_inspection = '')
|
||||
{cond} {mcond} order by item_code limit {start}, {page_len}""".format(doc=filters.get('from'),
|
||||
parent=filters.get('parent'), cond=cond, mcond=mcond, start=start, page_len = page_len),
|
||||
{qi_condition} {cond} {mcond}
|
||||
order by item_code limit {start}, {page_len}""".format(doc=filters.get('from'),
|
||||
parent=filters.get('parent'), cond = cond, mcond = mcond, start = start,
|
||||
page_len = page_len, qi_condition = qi_condition),
|
||||
{'parent': filters.get('parent'), 'txt': "%%%s%%" % txt})
|
||||
|
Loading…
x
Reference in New Issue
Block a user