diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 6a2bfd69702..be7747583c9 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -2163,7 +2163,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 dc97d90db7f..86280e58681 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -389,11 +389,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) { @@ -2885,11 +2887,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 3a417c570c9..ff2dd1818c0 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 81cbad37c24..973eecdae6a 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.json +++ b/erpnext/stock/doctype/stock_entry/stock_entry.json @@ -259,7 +259,6 @@ }, { "default": "0", - "depends_on": "eval: doc.purpose === \"Manufacture\"", "fieldname": "inspection_required", "fieldtype": "Check", "label": "Inspection Required" @@ -769,7 +768,11 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2026-03-04 19:03:23.426082", +======= + "modified": "2026-06-11 18:23:12.340065", +>>>>>>> dceb9a3c6c (fix(stock): enable quality inspection for all Stock Entry purposes) "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry",