fix: quality inspection item code fetch perm issue (#54121)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
Nishka Gosalia
2026-04-08 17:20:09 +05:30
committed by GitHub
parent 086122f650
commit 31319cb6ee
2 changed files with 3 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ frappe.ui.form.on("Quality Inspection", {
if (doc.reference_type && doc.reference_name) {
let filters = {
from: doctype,
parent_doctype: doc.reference_type,
inspection_type: doc.inspection_type,
};

View File

@@ -370,10 +370,11 @@ def item_query(doctype: Any, txt: str | None, searchfield: Any, start: int, page
from frappe.desk.reportview import get_match_cond
from_doctype = cstr(filters.get("from"))
parent_doctype = cstr(filters.get("parent_doctype"))
if not from_doctype or not frappe.db.exists("DocType", from_doctype):
return []
mcond = get_match_cond(from_doctype)
mcond = get_match_cond(parent_doctype or from_doctype)
cond, qi_condition = "", "and (quality_inspection is null or quality_inspection = '')"
if filters.get("parent"):