From 1679680d8e2b62a65e5475cae99ee5329b1ce4d5 Mon Sep 17 00:00:00 2001 From: Sudharsanan11 Date: Fri, 29 May 2026 18:06:32 +0530 Subject: [PATCH] fix(stock): add warning message to notify the user to configure the inspection (cherry picked from commit e003fe4de0b9fa59a054bfa348837d8ba1acf9ab) --- erpnext/public/js/controllers/transaction.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index ead1639f5cb..f8abb214533 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2934,6 +2934,23 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe }, freeze: true, callback: function (r) { + if (r.message.length == 0) { + let type = inspection_type === "Incoming" ? "Purchase" : "Delivery"; + let fieldname = + inspection_type === "Incoming" + ? "Inspection Required before Purchase" + : "Inspection Required before Delivery"; + + frappe.msgprint({ + title: __("Quality Inspection Not Configured"), + message: __(`Enable {0} on the Item master to proceed with {1} inspection.`, [ + fieldname, + type, + ]), + }); + return; + } + r.message.forEach((item) => { if (me.has_inspection_required(item)) { let dialog_items = dialog.fields_dict.items;