Skip to content
Operations · Quality management module

A quality management system that stops bad lots at the receiving dock

Most quality problems are found too late, after the bad lot has been mixed, packed or shipped. A quality management system inside your ERP catches them while the goods are still on the dock. Tell erpfly what you test, who signs off and what happens to a failed lot, and it generates the Odoo addon or ERPNext app.

ERPNext v16

Works with ERPNext v15 and v16, and Odoo 17, 18 and 19.

Features

What your quality management module can do

Inspections at the right moment

Checks on receipt, between operations or before dispatch, attached to the stock transaction so they can't be skipped by accident.

Pass and fail from real limits

Numeric readings compared against limits per product, so "moisture 13.4" becomes a fail without someone deciding how strict to feel today.

Lot holds that actually hold

A failed lot is blocked from receipt or moved to a quarantine location, and it stays there until someone with the right role releases it.

Non-conformance with an owner

Every failure opens a record with a cause, a corrective action, a due date and a person. Overdue actions show up on a list, not in a memory.

Supplier scorecards from inspection data

Pass rates per supplier and per product, built from the inspections you're already doing, ready for your next supplier review.

The output

What actually gets generated

Real files in a real repository. Here’s the typical output when someone asks for quality management.

ERPNext / Frappe app

  • Quality Inspection Templates and Parameters with your limits
  • Inspection Required flags on Item for purchase and delivery
  • doc_events on Purchase Receipt sending rejected batches to a quarantine Warehouse
  • Non Conformance and Quality Action records created from failures
  • Supplier pass-rate Script Report

Odoo addon

  • incoming.inspection model for Community (or quality.point on Enterprise)
  • button_validate override on stock.picking
  • requires_inspection field on product.template
  • Quarantine stock.location and release rights
  • Access rules in ir.model.access.csv and inspection list view
lot_inspection/models/inspection.py
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError


class IncomingInspection(models.Model):
    _name = "incoming.inspection"
    _description = "Incoming lot inspection"

    picking_id = fields.Many2one("stock.picking", required=True, ondelete="cascade")
    lot_id = fields.Many2one("stock.lot", required=True)
    moisture_pct = fields.Float(digits=(5, 2))
    limit_pct = fields.Float(default=12.0)
    result = fields.Selection([("pass", "Pass"), ("fail", "Fail")], compute="_compute_result", store=True)

    @api.depends("moisture_pct", "limit_pct")
    def _compute_result(self):
        for rec in self:
            rec.result = "pass" if rec.moisture_pct <= rec.limit_pct else "fail"

    @api.constrains("moisture_pct")
    def _check_reading(self):
        if any(not 0 < rec.moisture_pct < 100 for rec in self):
            raise ValidationError(_("Enter a moisture reading between 0 and 100."))


class StockPicking(models.Model):
    _inherit = "stock.picking"

    def button_validate(self):
        for picking in self.filtered(lambda p: p.picking_type_code == "incoming"):
            lots = picking.move_line_ids.filtered(lambda ml: ml.product_id.requires_inspection).lot_id
            passed = self.env["incoming.inspection"].search([("picking_id", "=", picking.id), ("result", "=", "pass")]).lot_id
            if lots - passed:
                raise UserError(_("No passing inspection for lot(s): %s") % ", ".join((lots - passed).mapped("name")))
        return super().button_validate()
Trimmed excerpt. The full module includes tests, fixtures and a README.

How it works

From a paragraph to a pull request

The long version
  1. 01

    Describe it

    In your own words. Paste the spreadsheet or a photo of the paper form if that's easier.

  2. 02

    Answer a couple of questions

    It asks only what it can't work out from your setup, like who's allowed to override.

  3. 03

    Try it on a sandbox

    A copy of your site with the module installed. Break it, then ask for changes.

  4. 04

    Merge when it's right

    Code lands as a pull request with tests. Your developer, or ours, reviews it first.

The inspection that happens after the goods are used

Here’s how quality goes wrong in most small and mid-sized companies. The inspection exists. It’s on a clipboard by the dock, or in a spreadsheet the quality lead updates on Fridays. Meanwhile the receiver has already booked the goods into stock, production has already used half the lot, and the failed result turns up three days later as a sad email.

The fix isn’t more checking. It’s putting the check in the path of the transaction so the receipt, the job or the delivery can’t finish until the result exists.

Building a quality management system inside the ERP, not beside it

A standalone QMS tool is fine for documents and audits. The trouble is it doesn’t know when stock moves. Your ERP does.

ERPNext is well equipped here. Quality Inspection is standard and can be required before purchase, before delivery or during manufacturing. Templates hold parameters and acceptable ranges. The Quality module adds Non Conformance, Quality Action, Quality Procedure and Quality Review. Most of our ERPNext work in this area is configuration plus a few doc_events that turn a rejected inspection into a hard stop and a Non Conformance record.

Odoo splits by edition. The Quality app, with quality points, checks and alerts, is Enterprise. On Community there’s nothing built in, so we generate a lean inspection model, a quarantine location and a validation override. The code on this page is the core of it. If you’re choosing between the two for a quality-heavy operation, the ERPNext vs Odoo comparison is worth ten minutes.

Worked example: moisture limits for a food ingredients importer

Picture an importer of rice and pulses running Odoo Community. A container arrives with 18 lots. Grain over 12% moisture goes mouldy in storage, so the quality lead, Chidi, samples one bag per lot.

What the prompt asked for:

  • Products flagged “requires inspection” can’t be received until every lot on the receipt has a passing reading.
  • A reading above the product’s limit is a fail. The limit defaults to 12% and can be changed per inspection.
  • Failed lots open a non-conformance for Chidi with the supplier and container number.

Seventeen lots read between 10.8% and 11.9%. Lot 7 reads 13.4%. When the receiver clicks Validate, Odoo refuses and names lot 7. Now there are two legitimate paths: re-sample it (sometimes the first bag was from the wet corner of the container) or remove lot 7 from the receipt and raise a return. What doesn’t happen is 13.4% grain quietly sitting next to good stock for a month.

It adds maybe 20 minutes of sampling per container. Chidi was doing that anyway. She just wasn’t able to stop anything. The non-conformance record and a quarantine location come with the same addon, so the supplier conversation starts with a lot number and a reading instead of a vague complaint.

What we won’t pretend a module can do

Make you certified. We don’t hand out ISO certificates and neither does software. We generate the records. You run the system.

Replace judgement on borderline results. A reading of 12.05% against a 12% limit is a conversation. Give someone the right to release a lot with a reason, and log it.

Inspect everything, always. Sampling plans exist for a reason. If your team has to test every carton of a supplier with a clean two-year record, they’ll start faking readings. Skip-lot rules are better than fiction.

Carry your whole document library. Controlled procedures and training records can live in the ERP, but if you already have a working document system, link to it.

Where quality connects

Inspections sit on top of receipts from purchase management, and in-process checks belong on work orders in manufacturing. Quarantine and release are really stock movements, so inventory management should be solid first. Food businesses in particular should read our notes on ERP for food and beverage companies, where lot traceability matters as much as the test itself. Odoo users can see how we extend the standard apps in Odoo customization.

Guides and terms for quality management

Quality management module questions

Something missing? Email hello@erpfly.com and a person will answer.

Will this make us ISO 9001 compliant?

No software does that on its own. Certification comes from your processes and an external audit. What a well-built module gives you is the evidence auditors ask for, like inspection records, non-conformances and closed corrective actions, without digging through email.

Do we need Odoo Enterprise for quality checks?

Odoo's Quality app (quality.point, quality.check, quality.alert) is Enterprise only. On Enterprise we extend it. On Community we generate a smaller inspection model like the one on this page, which covers most receiving and in-process checks.

What does ERPNext already include for quality?

Quite a lot. Quality Inspection with templates and parameters, inspection-required flags on items, plus Quality Goal, Quality Procedure, Non Conformance and Quality Action. We usually configure those and add only the blocking rules and reports that are missing.

Can inspection readings come from lab instruments?

If the instrument or its software can export CSV or call an API, yes. We generate an import or endpoint that matches readings to lots. Instruments that only print to paper still need a person with a keyboard, sadly.

We track quality in spreadsheets today. Can we bring history over?

Open non-conformances and supplier records are worth importing. Years of old pass results usually aren't, unless an auditor or customer needs them. Keep the old files read-only and start clean from go-live.

How long does it take to set up?

Generating the module is quick. Agreeing on limits per product with your quality lead and purchasing takes longer, usually a week or two of meetings. Do that first.

Your next module is one paragraph away

Write it the way you’d explain it to a new hire. We’ll turn it into an app you can read, test and install.

ERPNext v16

Create your account

Free to start. No card needed.

By signing up you agree to our terms and privacy policy.