fix: unknown column error on item code in quality inspection (#54565)

This commit is contained in:
Mihir Kandoi
2026-04-28 10:19:43 +05:30
committed by GitHub
parent 78b2e45cb9
commit e7a29abdb0

View File

@@ -394,7 +394,8 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
f"""
SELECT distinct item_code, item_name
FROM `tab{from_doctype}`
WHERE parent=%(parent)s and docstatus < 2 and item_code like %(txt)s
JOIN `tab{parent_doctype}` ON `tab{parent_doctype}`.name = `tab{from_doctype}`.parent
WHERE parent=%(parent)s and `tab{parent_doctype}`.docstatus < 2 and item_code like %(txt)s
{qi_condition} {cond} {mcond}
ORDER BY item_code limit {cint(page_len)} offset {cint(start)}
""",