Skip to main content

Manufacturing & distribution

How to Set Up Quality Inspection in ERPNext Manufacturing

ERPNext Quality Inspection can stop a Stock Entry until readings pass, if it is switched on in the right places. Templates, triggers and rejections.

Updated 12 Oct 202610 min readBy ManojFirst published 4 Aug 2026

Your team submits a Stock Entry for a finished batch of 200 units. No one inspected it, the entry goes through, the goods move to finished stock, and a week later a customer reports 30 units out of spec. ERPNext can stop that entry until an inspection is submitted, but only when inspection is switched on where it belongs: on the BOM for manufacture, on the Item for purchase and delivery, with a template to inspect against and the Stock Settings action set to Stop. Miss one, and goods go through unchecked.

Quality Inspection in ERPNext is a gate, not a monitor. It doesn't watch continuously; it holds a specific transaction (a Stock Entry, Purchase Receipt or Delivery Note) until an inspector records readings and marks the inspection Accepted or Rejected. The gate only holds when the setup is complete. I am Manoj, and I lead ERPNext and Frappe implementations at MithTech, a team of Frappe specialists in Bengaluru. Quality gates come up early with manufacturers who work to ISO 9001 or a customer's quality plan.

When does Quality Inspection trigger?

Quality Inspection in ERPNext isn't automatic: it is a gate on specific transactions. It applies at different points depending on what you switch on.

Interactive

Inspection Flow Simulator

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.

Step 1 of 5

Work Order is submitted
Work Orderstatus

The Quality Inspection Template on the Item sets the inspection rule. ERPNext reads it at submit time and decides whether to require a QI.

The critical point: for manufacture, the switch is "Quality Inspection Required" on the BOM the Work Order uses. A template linked on the Item is not enough on its own, and if Stock Settings is set to Warn rather than Stop, a missing or rejected inspection gives a warning and the entry still submits.

How do you design an inspection template?

A Quality Inspection Template defines what is inspected: the parameters, the acceptable values and the units. The Template Builder below lets you design one.

Interactive

QI Template Builder

Build a Quality Inspection Template with numeric parameters (min/max ranges) and visual pass/fail checks. The example is a shaft assembly with four parameters; change it or start fresh.

Parameter 1
Parameter 2
Parameter 3
Template Preview
#ParameterSpecificationMinMaxUOM
1Outer diameter20 mm nominal19.9520.05mm
2Length100 mm nominal99.5100.5mm
3Surface finishRa 0.8——µm
TemplateShaft Assembly
Parameters3
Numeric checks2

When you design templates:

  1. Numeric parameters with minimum and maximum values are the most useful: they give you data for trends and capability studies, and leave no room for interpretation.
  2. Pass/fail parameters (no numeric range) are for checks you can't measure: surface finish, colour match, label present. Use them sparingly; they depend on the inspector's judgement.
  3. One template per product family, not per product. If five shaft variants share the same requirements, use one template and link it to each item.
  4. Keep the list short. A long list slows the inspector and invites mistakes. If you need many checks, split them into an incoming-material template and a final-inspection template.

What do the automation scripts do?

Three scripts complete the workflow: auto-creation (so inspectors don't create inspections by hand), rejection handling (so rejected goods move to the right warehouse) and a report query (so you can track pass and fail rates).

Code recipe

Quality Inspection Recipe

Python recipe: auto-create QI on a Manufacture Stock Entry, handle rejections with a warehouse transfer, and query pass/fail rates for a QI report.

Server Script that auto-creates Quality Inspection on Stock Entry (Manufacture) submission.

python
# 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

        # Create the QI
        qi = frappe.new_doc("Quality Inspection")
        qi.item_code = item.item_code
        qi.quality_inspection_template = qi_template
        qi.reference_type = "Stock Entry"
        qi.reference_name = doc.name
        qi.inspection_type = "In Process"
        qi.sample_size = 1
        qi.insert(ignore_permissions=True)

        # Link it back
        frappe.db.set_value(
            "Stock Entry Item",
            item.name,
            "quality_inspection",
            qi.name,
        )

0 of 5 steps done

Tick a step’s number when it is done; the ticks stay on this device.

Add the auto-creation server script

Go to Server Script, New, with Stock Entry as the reference doctype. The script checks whether the entry is a Manufacture and whether the finished item has a template; if so, it creates a Quality Inspection filled with the template's parameters and links it to the entry's row.

Choose a rejection warehouse

Create a warehouse for rejected goods under your manufacturing warehouse group, for example "Rejected - Plant 1". ERPNext has no default rejection warehouse setting for manufacture, so the script needs this warehouse named in it. On purchase receipts, the receipt's own Rejected Warehouse field does this job.

Add the rejection handler

Create another server script on Quality Inspection, on submit. When an inspection is submitted as Rejected, it creates a Material Transfer moving the goods from the work-in-progress warehouse to your rejection warehouse.

Build the report

Create a Script Report from the report query. It shows pass and fail rates by item and template, lowest pass rate first: the items that need attention. Use the date filter to track improvement.

Test the whole flow

On a test Work Order, make the Manufacture Stock Entry and check the inspection is created. Enter readings within spec, submit the inspection, then the entry: the goods move to finished stock. Then test a rejection: readings out of spec, inspection submitted as Rejected, and check the entry is stopped and the transfer is created.

What is on the QI readiness checklist?

Before you go live with quality inspection in manufacturing, check every setting. The checklist below lists the requirements; where it names a setting, use the v15 locations in the callout above.

Interactive

QI Readiness Checklist

Configuration items to verify before enabling Quality Inspection in your ERPNext manufacturing workflow. Check each one off as you confirm it.

QI Readiness0/8 (0%)

What should you know before you commit?

Inspection takes time. Every Manufacture Stock Entry now needs an inspection. If the floor submits many entries a day, that is many inspections, and each takes longer the more parameters it has. Decide whether you inspect every batch or a sample.

Formula-based criteria. A template parameter can use a formula as its acceptance criterion instead of a minimum and maximum, by ticking "Formula Based Criteria" and writing the condition. Use it for acceptance logic a simple range can't express.

Incoming material. The same templates work for incoming inspection. Tick "Inspection Required before Purchase" on the raw-material Item, and the Purchase Receipt needs an inspection before it submits (with Stock Settings set to Stop). Link different templates for raw materials and finished goods.

Batch-wise inspection. If your items use batches, make one inspection per batch, not per Stock Entry, and set the batch on the Quality Inspection. That lets you trace a quality problem back to a batch. The Trace a bad batch demo shows that trace on a demo company.

Trigger pointWhere to switch it onTransaction heldCommon use
Purchase ReceiptItem: Inspection Required before PurchasePurchase ReceiptIncoming raw material
Stock Entry (Manufacture)BOM: Quality Inspection Required + templateManufacture Stock EntryFinished goods after production
Job Card (operation)Operation: Quality Inspection TemplateJob CardIn-process checks at an operation
Delivery NoteItem: Inspection Required before DeliveryDelivery NoteOutgoing check before dispatch
Quality Inspection trigger points in ERPNext v15; Stock Settings decides Stop or Warn

At a glance

AspectWhat to know
ManufactureBOM: "Quality Inspection Required" and a template
Purchase and deliveryItem: "Inspection Required before Purchase" / "before Delivery"
Stop or warnStock Settings: actions if not submitted, and if rejected
Rejected goodsPurchase Receipt has a Rejected Warehouse; for manufacture, move them with a script or by hand

Frequently asked questions

How do I set up Quality Inspection in ERPNext manufacturing?

Create a Quality Inspection Template with parameters and acceptable values, tick "Quality Inspection Required" on the finished item's BOM and choose the template, and set the two Stock Settings actions to Stop. From then on, the Manufacture Stock Entry needs a submitted, accepted Quality Inspection before it submits.

Why can I submit a Stock Entry without Quality Inspection?

Usually one of three reasons: the BOM the Work Order uses doesn't have "Quality Inspection Required" ticked; Stock Settings is set to Warn, not Stop, for a missing inspection; or the entry is not a Manufacture (for purchase and delivery the switch is on the Item). Check all three.

How do I auto-create Quality Inspection in ERPNext?

Add a server script on Stock Entry. It checks whether the entry is a Manufacture and the finished item has a template; if so, it creates a Quality Inspection filled with the template's parameters and links it to the entry. The inspector enters the readings before the entry can be submitted.

What happens when Quality Inspection is rejected in ERPNext?

With Stock Settings set to Stop for rejected inspections, the transaction is held. On a purchase receipt, rejected quantity can go to the receipt's Rejected Warehouse. On a manufacture entry, ERPNext doesn't move the goods by itself, so use a script like the one in this guide, or a manual Material Transfer, to move them to a rejection warehouse.

Can I use Quality Inspection for incoming materials in ERPNext?

Yes. Tick "Inspection Required before Purchase" on the raw-material Item and link a template. The Purchase Receipt then needs a Quality Inspection before it submits, if Stock Settings is set to Stop. Use different templates for raw materials and finished goods.

How do I track quality inspection pass/fail rates in ERPNext?

Create a Script Report on the Quality Inspection doctype that groups by item and template and counts Accepted against Rejected. The report query in this guide does this; filter by date to track improvement and sort by lowest pass rate to see which items need attention.

What is a Quality Inspection Template in ERPNext?

It defines the inspection for an item: parameter names, acceptable minimum and maximum values or a formula, and whether a parameter is numeric. When a Quality Inspection is created, the parameters are copied from the template; the inspector enters readings and ERPNext checks them against the criteria.

Which ERPNext version does this guide apply to?

ERPNext v15; the setting names were checked against the v15 source on 12 October 2026. The server scripts use standard Frappe calls. Check the BOM, Item and Stock Settings forms on your own version if you are on v14 or v16.

Quality Inspection in ERPNext is a gate: it holds a transaction until an inspection is accepted. It only holds when inspection is switched on in the right place (the BOM for manufacture, the Item for purchase and delivery) and Stock Settings says Stop. The auto-creation script removes the manual step teams skip, and the rejection handler moves defective goods out of the production flow.

Live demo

Your next step

Setting up quality control in ERPNext manufacturing?

Goods arrive and get checked

The delivery is scanned in, inspected and stored by batch, and the order already knows.

You end with a batch tracked · 3 screens · about 5 min

No sign-up, no card, no account.

Manufacturing & distribution

Now see how ERPNext runs a plant like yours

How we set up ERPNext for manufacturers, from bills of materials and job work to costing and the shop floor.

Comments & ratings

No comments yet. Start a new discussion.

0

Manoj · Published on 4 August 2026

Worked with us? Leave a Google review

Questions about this? Talk to the team.

Book a 30-minute Google Meet, WhatsApp us, or send a message. The engineer who works on this replies.

Send us a message

Your details go to our team's CRM and are used only to reply.