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

Co-authored-by: Nishka Gosalia <58264710+nishkagosalia@users.noreply.github.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
fix: quality inspection item code fetch perm issue (#54121)
This commit is contained in:
mergify[bot]
2026-04-08 12:05:39 +00:00
committed by GitHub
parent d39d076fba
commit bcd6d99549
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

@@ -364,10 +364,11 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
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"):