From e0cea492361e9abd57a649ffe22188914ae66aa5 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 28 Apr 2025 13:27:57 +0530 Subject: [PATCH] fix: allow to make quality inspection after Purchase / Delivery (cherry picked from commit fad1a32e632056d5c62b864d1276b7fce161e228) --- erpnext/controllers/stock_controller.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index fbc98a1a2f4..eb33187033d 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -1047,6 +1047,16 @@ class StockController(AccountsController): def validate_qi_presence(self, row): """Check if QI is present on row level. Warn on save and stop on submit if missing.""" + if self.doctype in [ + "Purchase Receipt", + "Purchase Invoice", + "Sales Invoice", + "Delivery Note", + ] and frappe.db.get_single_value( + "Stock Settings", "allow_to_make_quality_inspection_after_purchase_or_delivery" + ): + return + if not row.quality_inspection: msg = _("Row #{0}: Quality Inspection is required for Item {1}").format( row.idx, frappe.bold(row.item_code)