changes
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 5ea3dee..0b19b7a 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -343,8 +343,7 @@
 				qa_doc = frappe.get_doc("Quality Inspection", d.quality_inspection)
 				if qa_doc.docstatus == 0:
 					link = frappe.utils.get_link_to_form('Quality Inspection', d.quality_inspection)
-					frappe.msgprint(_("Quality Inspection: {0} is not submitted for the item: {1} in row {2}").format(link, d.item_code, d.idx))
-					raise QualityInspectionNotSubmittedError
+					frappe.throw(_("Quality Inspection: {0} is not submitted for the item: {1} in row {2}").format(link, d.item_code, d.idx), QualityInspectionNotSubmittedError)
 
 				qa_failed = any([r.status=="Rejected" for r in qa_doc.readings])
 				if qa_failed:
@@ -432,4 +431,4 @@
 			tuple([posting_date] + [d[1] for d in future_stock_vouchers]), as_dict=1):
 				gl_entries.setdefault((d.voucher_type, d.voucher_no), []).append(d)
 
-	return gl_entries
\ No newline at end of file
+	return gl_entries