Skip to main content

inventree-mbom

Manufacturing BOM & Routings plugin for InvenTree

License: MIT InvenTree


Overview

inventree-mbom extends InvenTree with a full Manufacturing BOM (mBOM) capability, adding a dedicated "Manufacturing Routing (mBOM)" tab to every assembly part. It supports:

  • Hierarchical process steps (Op 10 → 10.1 Stencil → 10.2 Pick & Place → 10.3 Reflow)
  • Central labor and machine rate catalog with dynamic cost propagation
  • Reusable process templates that can be applied to any assembly in one click
  • Setup Time (fixed/batch) + Run/Cycle Time (per unit) tracked separately
  • CO₂ emission factor tracking per machine center
  • Full pricing integration: manufacturing costs bridge into InvenTree's native PartPricing system

Features

Central Tariff Catalog

Model Fields
LaborRate Name, hourly rate, currency, description
MachineCenter Name, hourly rate, currency, CO₂ factor/min

Process Templates

Create reusable templates (e.g. "SMT Assembly Standard") with hierarchical steps. Apply them to any assembly with one click.

Part Routing (mBOM)

Each assembly gets a PartRouting containing RoutingOperation instances:

PartRouting (for Part: Widget PCB)
├── Op 10: SMT Assembly         [Labor: Assembler, Setup: 30min, Cycle: 2min/unit]
│   ├── Op 10.1: Stencil Paste
│   ├── Op 10.2: Pick & Place
│   └── Op 10.3: Reflow
└── Op 20: Final Inspection     [Labor: Engineer, Cycle: 5min/unit]

Cost Formula

Total Operation Cost (batch) = (Setup_min × Rate/min) + (Cycle_min/unit × Rate/min × batch_qty)
Per-Unit Cost = Total Cost ÷ batch_size
Total Assembly Cost = eBOM Material Cost + mBOM Labor Cost + mBOM Machine Cost

Pricing Bridge

When a LaborRate or MachineCenter hourly rate is updated, Django post_save signals automatically call PartPricing.schedule_for_update() on all affected assemblies — no InvenTree core modifications required.


Installation

1. Install in editable mode (for development)

# Inside the InvenTree virtual environment
pip install -e /path/to/inventree-mbom

2. Enable the plugin in InvenTree

Go to Settings → Plugins and enable inventree-mbom.

3. Run database migrations

# If using InvenTree's invoke tasks:
invoke migrate

# Or directly:
python manage.py migrate inventree_mbom

4. Verify installation

Navigate to any assembly part → you should see the "Manufacturing Routing (mBOM)" tab.


REST API Endpoints

All endpoints are under /plugin/inventree-mbom/:

Method Endpoint Description
GET/POST labor-rate/ List/Create labor rates
GET/PUT/DELETE labor-rate/<pk>/ Retrieve/Update/Delete labor rate
GET/POST machine-center/ List/Create machine centers
GET/PUT/DELETE machine-center/<pk>/ Retrieve/Update/Delete machine center
GET/POST process-template/ List/Create process templates
GET/POST process-template-step/ List/Create template steps
GET/POST routing/ List/Create part routings
GET/PUT/DELETE routing/<pk>/ Retrieve/Update/Delete routing
GET/POST operation/ List/Create routing operations
GET/PUT/DELETE operation/<pk>/ Retrieve/Update/Delete operation
POST apply-template/ Apply a template to a part's routing
GET cost-summary/<part_pk>/ Full cost breakdown for a part

Development Setup

git clone https://github.com/0neShot/inventree-mbom
cd inventree-mbom
pip install -e .

Running Tests

# From InvenTree root:
python manage.py test inventree_mbom

Architecture & Design Decisions

Why Not a Standalone SPA?

This plugin uses InvenTree's native UserInterfaceMixin + PanelMixin pattern to inject the mBOM tab. The panel renders server-side HTML with vanilla JS for API interactions, matching InvenTree's native look & feel without requiring a separate build pipeline.

Pricing Bridge Strategy

InvenTree's PartPricing.bom_cost only rolls up physical BOM items. Rather than patching InvenTree core, this plugin uses Django's post_save signal on LaborRate/MachineCenter to call PartPricing.schedule_for_update() on affected parts. The cost summary API endpoint provides the full breakdown (material + labor + machine) for display in the UI panel.

Template vs. Instance Pattern

Process Templates are reusable blueprints. When applied to a part, operations are copied (not linked) so engineers can customize times/notes per-part without mutating the global template. The source_template FK is informational only.


License

MIT License - see LICENSE

Metadata

Release files for inventree-mbom 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inventree-mbom 0.1.0
File Size Uploaded
inventree_mbom-0.1.0.tar.gz 64.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inventree-mbom 0.1.0
File Interpreter ABI Platform
inventree_mbom-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 129.0 kB

Release files / inventree_mbom-0.1.0.tar.gz

Download URL inventree_mbom-0.1.0.tar.gz
Size 64.2 kB
Tags Source
SHA-256 checksum
How to use checksums
07b49c6b417b8ae54af4389ccee78b261e1487aed190f3f0ca36f02e5bd3ba3a
BLAKE2b-256 checksum
How to use checksums
3f60c7c200ea1f00fee9bf238dbafc72becb5d729ca6c4e513563ba88e353af2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / inventree_mbom-0.1.0-py3-none-any.whl

Download URL inventree_mbom-0.1.0-py3-none-any.whl
Size 64.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e05ab55eb738048e05396d8938d3acef24ab068f6a5e475cc188f0141281720f
BLAKE2b-256 checksum
How to use checksums
099c7844d9af20aa06f4a5007ab82098e5d1da2cdc7b1fced8ad2ee15e3469ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page