diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 904d600c9a8..b987a9d2946 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -632,7 +632,7 @@ def check_item_quality_inspection(doctype: str, docstatus: str | int, items: str inspection_fieldname = INSPECTION_FIELDNAME_MAP.get(doctype) if inspection_fieldname is None: - return [] + return items if doctype == "Stock Entry" else [] allow_after_transaction = cint(docstatus) == 1 and frappe.get_single_value( "Stock Settings", "allow_to_make_quality_inspection_after_purchase_or_delivery" diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index deaf50846de..b41c01927b3 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -404,11 +404,13 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe ); } - const inspection_type = ["Purchase Receipt", "Purchase Invoice", "Subcontracting Receipt"].includes( - this.frm.doc.doctype - ) - ? "Incoming" - : "Outgoing"; + const incoming_doctypes = ["Purchase Receipt", "Purchase Invoice", "Subcontracting Receipt"]; + const incoming_purposes = ["Manufacture", "Material Receipt"]; + const inspection_type = + incoming_doctypes.includes(this.frm.doc.doctype) || + (this.frm.doc.doctype === "Stock Entry" && incoming_purposes.includes(this.frm.doc.purpose)) + ? "Incoming" + : "Outgoing"; let quality_inspection_field = this.frm.get_docfield("items", "quality_inspection"); quality_inspection_field.get_route_options_for_new_doc = function (row) { @@ -2894,11 +2896,13 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe ]; const me = this; - const inspection_type = ["Purchase Receipt", "Purchase Invoice", "Subcontracting Receipt"].includes( - this.frm.doc.doctype - ) - ? "Incoming" - : "Outgoing"; + const incoming_doctypes = ["Purchase Receipt", "Purchase Invoice", "Subcontracting Receipt"]; + const incoming_purposes = ["Manufacture", "Material Receipt"]; + const inspection_type = + incoming_doctypes.includes(this.frm.doc.doctype) || + (this.frm.doc.doctype === "Stock Entry" && incoming_purposes.includes(this.frm.doc.purpose)) + ? "Incoming" + : "Outgoing"; const dialog = new frappe.ui.Dialog({ title: __("Select Items for Quality Inspection"), size: "extra-large", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 06b995b65a9..58185d3c40e 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -216,10 +216,11 @@ frappe.ui.form.on("Stock Entry", { } let quality_inspection_field = frm.get_docfield("items", "quality_inspection"); + const incoming_purposes = ["Manufacture", "Material Receipt"]; quality_inspection_field.get_route_options_for_new_doc = function (row) { if (frm.is_new()) return {}; return { - inspection_type: "Incoming", + inspection_type: incoming_purposes.includes(frm.doc.purpose) ? "Incoming" : "Outgoing", reference_type: frm.doc.doctype, reference_name: frm.doc.name, child_row_reference: row.doc.name, diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json index f6f2d821cc8..3e305ada502 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.json +++ b/erpnext/stock/doctype/stock_entry/stock_entry.json @@ -260,7 +260,6 @@ }, { "default": "0", - "depends_on": "eval: doc.purpose === \"Manufacture\"", "fieldname": "inspection_required", "fieldtype": "Check", "label": "Inspection Required" @@ -774,7 +773,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-04-21 13:31:48.817309", + "modified": "2026-06-11 18:23:12.340065", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry",