Your manufacturing team submits a Stock Entry for a finished batch of 200 units. No Quality Inspection was performed — the Stock Entry goes through, the items move to finished goods, and a week later a customer reports that 30 units are out of spec. ERPNext has a Quality Inspection module that blocks submission until readings pass, but it only works if three things are correctly configured: the item has a QI template linked, Manufacturing Settings has inspection enabled, and the inspector creates the QI before submitting the Stock Entry. Miss any one of these, and defective items flow through unchecked. GitHub #50876 and Forum #149464 document the exact configuration gaps.
Production planning feeding into QI?
Quality Inspection happens after production completes. If your Production Plan is not picking up partially delivered SOs correctly, see the Production Plan partial fulfillment guide first. For payment reconciliation automation, see the Payment Reconciliation guide.
Quality Inspection in ERPNext is a gate, not a tracker. It does not continuously monitor — it blocks a specific transaction (Stock Entry, Purchase Receipt, Delivery Note) until an inspector records readings and marks the inspection as Accepted or Rejected. The power is in the blocking. But the blocking only works when the configuration is complete. I am Manoj, ERP implementation lead at Mith Tech in Bengaluru, and setting up quality gates in ERPNext manufacturing is one of the most common requests from our ISO-certified clients.
When does Quality Inspection trigger?
Quality Inspection in ERPNext is not automatic — it is a gate that blocks specific transactions. The gate activates at different points depending on the transaction type:
Select a scenario — Purchase Receipt, Work Order Completion, or Delivery Note — and click through each step to see when QI triggers, what the inspector fills in, and what happens on Accept vs Reject.
Work Order in process
Work Order is running. A Stock Entry of type "Manufacture" is created to receive finished goods.
The critical point: if "Quality Inspection Required during Manufacture" is not enabled in Manufacturing Settings, Stock Entries of type "Manufacture" submit without any inspection check. The item can have a QI template linked, but without the setting enabled, ERPNext does not enforce it.
Designing your inspection template
A Quality Inspection Template defines what gets inspected — the parameters, acceptable ranges, and measurement units. The Template Builder below lets you design one interactively:
Build a Quality Inspection Template with numeric parameters (min/max ranges) and visual/pass-fail checks. The pre-loaded example is a shaft assembly with four parameters — modify it or start fresh.
Template Preview
| # | Parameter | Specification | Min | Max | UOM |
|---|---|---|---|---|---|
| 1 | Outer Diameter | Must be within tolerance | 24.95 | 25.05 | mm |
| 2 | Surface Roughness | Ra value per ISO 4287 | 0 | 1.6 | Ra |
| 3 | Hardness (HRC) | Rockwell C hardness | 58 | 62 | HRC |
| 4 | Visual Inspection | No cracks, burrs, or discoloration | -- | -- | Accept/Reject |
When designing templates, follow these principles:
- Numeric parameters with min/max ranges are most useful — they give you data for statistical analysis (Cpk, trends) and leave no room for subjective interpretation.
- Visual/pass-fail parameters (no numeric range) are for checks that cannot be measured: surface finish, colour match, label presence. Use sparingly — they depend on inspector judgement.
- One template per product family, not per product. If five shaft variants share the same quality requirements, use one template. Link it to each Item individually.
- Keep parameters under 10. More than 10 parameters per inspection slows down the inspector and increases error rates. If you need more, consider splitting into incoming material inspection and final inspection templates.
The automation scripts
Three scripts complete the QI workflow: auto-creation (so inspectors do not manually create QI docs), rejection handling (so rejected items move to the right warehouse), and a dashboard query (so you can track pass/fail rates):
Three-tab Python recipe: auto-create QI on Manufacture Stock Entry, handle rejections with warehouse transfer, and query pass/fail rates for a QI dashboard.
Server Script that auto-creates Quality Inspection on Stock Entry (Manufacture) submission.
# Server Script: auto-create Quality Inspection
# on Stock Entry (Manufacture) submission
# Trigger: Before Submit on Stock Entry
# See: GitHub #53784, Forum #149464
import frappe
def before_submit(doc, method=None):
if doc.stock_entry_type != "Manufacture":
return
for item in doc.items:
if not item.t_warehouse:
continue # skip source items
# Check if item requires inspection
qi_template = frappe.db.get_value(
"Item",
item.item_code,
"quality_inspection_template",
)
if not qi_template:
continue
# Check if QI already linked
if item.quality_inspection:
continue
# Auto-create Quality Inspection
qi = frappe.new_doc("Quality Inspection")
qi.inspection_type = "In Process"
qi.reference_type = "Stock Entry"
qi.reference_name = doc.name
qi.item_code = item.item_code
qi.sample_size = item.qty
qi.inspected_by = frappe.session.user
qi.quality_inspection_template = qi_template
# Load template parameters
template = frappe.get_doc(
"Quality Inspection Template", qi_template
)
for param in template.item_quality_inspection_parameter:
qi.append("readings", {
"specification": param.specification,
"min_value": param.min_value,
"max_value": param.max_value,
"formula_based_criteria": param.formula_based_criteria,
"acceptance_formula": param.acceptance_formula,
})
qi.insert(ignore_permissions=True)
item.quality_inspection = qi.name
frappe.msgprint(
"Quality Inspections created. Fill in readings before submitting.",
alert=True,
)Add the auto-creation server script
Go to Server Script → New. Set type to "Before Submit", reference doctype to "Stock Entry". Paste the auto-creation script. This fires when any Stock Entry is submitted — it checks if the type is "Manufacture" and if the target items have QI templates. If so, it creates a Quality Inspection document pre-filled with the template parameters.
Add the rejection handler
Create another Server Script. Set type to "On Submit", reference doctype to "Quality Inspection". Paste the rejection workflow script. When a QI is submitted with status "Rejected", it creates a Material Transfer Stock Entry moving the items from the WIP warehouse to the rejection warehouse configured in Manufacturing Settings.
Configure the rejection warehouse
Go to Manufacturing Settings → set "Default Rejection Warehouse". Create this warehouse under your manufacturing warehouse group if it does not exist. All rejected items will be transferred here automatically.
Build the dashboard
Create a Script Report using the dashboard query. This shows pass/fail rates by item and template, sorted by lowest pass rate first — the items that need the most quality attention. Use the date range filter to track improvement over time.
Verify the complete flow
Create a test Work Order, produce a Stock Entry (Manufacture). Verify the QI is auto-created. Fill in readings within spec → submit QI → submit Stock Entry → items move to finished goods. Then test rejection: fill in readings outside spec → submit QI as Rejected → verify Stock Entry is blocked and rejection transfer is created.
QI readiness checklist
Before going live with quality inspection in manufacturing, verify every configuration item. The checklist below tracks the eight requirements:
Eight configuration items to verify before enabling Quality Inspection in your ERPNext manufacturing workflow. Check each one off as you confirm it.
What to know before you commit
QI slows down submission. Every Manufacture Stock Entry now requires an inspection step. If your production floor submits 50 Stock Entries per day, that is 50 inspections. Plan for the time — each inspection takes 2–10 minutes depending on parameter count. Consider whether 100% inspection or sampling (inspect every Nth batch) is appropriate.
Formula-based criteria. ERPNext supports formula-based acceptance criteria in QI templates (e.g., reading_value > min_value and reading_value < max_value). Use these for complex acceptance logic like "reading must be within 2 standard deviations of the mean". Set formula_based_criteria = 1 on the template parameter.
QI for Purchase Receipts. The same template mechanism works for incoming material inspection. Enable "Quality Inspection Required during Purchase" in Stock Settings. This blocks Purchase Receipt submission until the received material passes inspection. Link a different QI template for raw materials vs finished goods.
Batch-wise inspection. If your items use batch numbers, create one QI per batch, not per Stock Entry. This lets you trace quality issues back to specific batches. Set the batch_no field on the Quality Inspection document.
+How do I set up Quality Inspection in ERPNext manufacturing?
Three steps: (1) Create a Quality Inspection Template with parameters and acceptable ranges, (2) link the template to the Item in the Item master → Quality tab, (3) enable "Quality Inspection Required during Manufacture" in Manufacturing Settings. After this, Stock Entry (Manufacture) submission requires a linked Quality Inspection with status "Accepted".
+Why can I submit a Stock Entry without Quality Inspection?
Three possible causes: (1) "Quality Inspection Required during Manufacture" is not enabled in Manufacturing Settings, (2) the item does not have a Quality Inspection Template linked in the Item master, (3) the Stock Entry type is not "Manufacture" (only Manufacture type is gated by the manufacturing setting). Check all three.
+How do I auto-create Quality Inspection in ERPNext?
Add a Server Script with event "Before Submit" on Stock Entry. The script checks if the Stock Entry type is "Manufacture" and if the target item has a QI template. If so, it creates a Quality Inspection document pre-filled with template parameters and links it to the Stock Entry item. The inspector fills in readings before the Stock Entry can be submitted.
+What happens when Quality Inspection is rejected in ERPNext?
By default, the Stock Entry submission is blocked — the items stay in the WIP warehouse. ERPNext does not automatically move rejected items to a separate warehouse. You need a custom script (provided in this guide) that creates a Material Transfer Stock Entry on QI rejection, moving items to a designated rejection warehouse.
+Can I use Quality Inspection for incoming materials in ERPNext?
Yes. Enable "Quality Inspection Required during Purchase" in Stock Settings. Link a QI template to the raw material Item. When a Purchase Receipt is submitted, ERPNext requires a linked Quality Inspection with status "Accepted" before allowing submission. Use different templates for raw materials vs finished goods.
+How do I track quality inspection pass/fail rates in ERPNext?
Create a Script Report or API endpoint that queries the Quality Inspection doctype, grouping by item_code and quality_inspection_template, counting Accepted vs Rejected status. The dashboard query in this guide provides this — filter by date range to track improvement over time. Sort by lowest pass rate to identify items needing attention.
+What is a Quality Inspection Template in ERPNext?
A Quality Inspection Template defines the inspection parameters for an item — parameter names, specifications, acceptable min/max values, and UOM. It is linked to an Item in the Item master. When a Quality Inspection is created, parameters are copied from the template. Inspectors fill in actual readings, and ERPNext compares readings against the acceptable ranges.
+What ERPNext version does this guide apply to?
This guide targets ERPNext v15. The Quality Inspection module, template system, and Manufacturing Settings have been stable across v14 and v15. The server scripts use standard Frappe ORM calls that work across versions. Formula-based criteria were introduced in v14. Check v16 release notes for any changes to the QI workflow.
Quality Inspection in ERPNext works as a gate — it blocks transactions until readings pass. But the gate only closes if three configuration items are in place: QI template on the item, the manufacturing setting enabled, and a QI document linked to the Stock Entry. The auto-creation script removes the manual step that most manufacturing teams skip. The rejection handler closes the loop by moving defective items out of the production flow.
Setting up quality control in ERPNext manufacturing?
We configure Quality Inspection workflows for manufacturing clients — templates, auto-triggering, rejection handling, and pass/fail dashboards. If your QI setup is not catching defects before they ship, we will fix the configuration.