diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index e5a62f2704..e2e920954b 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -632,7 +632,10 @@ def get_children(doctype, parent=None, is_root=False, **filters): return if frappe.form_dict.parent: - bom_items = frappe.get_list('BOM Item', + bom_doc = frappe.get_doc("BOM", frappe.form_dict.parent) + frappe.has_permission("BOM", doc=bom_doc, throw=True) + + bom_items = frappe.get_all('BOM Item', fields=['item_code', 'bom_no as value', 'stock_qty'], filters=[['parent', '=', frappe.form_dict.parent]], order_by='idx')