The production module in src/cluster_erp/modules/production/ covers manufacturing. It keeps work centers with their capabilities and hours, operation types, routings with operations and prep steps, routing templates, and component allocations that tie BOM items to operations. It creates production orders with components and operations, splits them into work orders, and places work orders on a scheduling board that respects working calendars. This page is the overview; the sub-topics have their own pages.
At a glance¶
| Item | Value | Source |
|---|---|---|
| Package | src/cluster_erp/modules/production/ |
folder |
| Module class | Module |
src/cluster_erp/modules/production/module.py:18 |
name / version |
production / 0.1.0 |
src/cluster_erp/modules/production/module.py:20-25 |
| API prefix | /api/v1/production (ModuleBase.api_prefix) |
src/cluster_erp/core/module_base.py:37-38 |
| Sub-modules | 10: work_centers, capacity, operation_types, routings, routing_templates, component_allocations, production_orders, production_versions, work_orders, scheduling |
folder listing |
| Tables | 16 | __tablename__ in the eight models.py files |
| Entities in metadata | 11 keys in entities |
src/cluster_erp/modules/production/module.py:2652-2664 |
| Routes | 102 route decorators in the package | grep for @...router.get/post/put/patch/delete |
| Actions | 0 ActionMeta entries; status changes use dedicated routes |
grep "ActionMeta(" in the package |
| Migrations | 27 files | files in migrations/versions/ whose text contains one of the 16 table names |
| Web app presence | Catalogue app production; custom widgets scheduling_board, capacity_workbench, capability_checklist, and the home widget home_scheduling from a gated bundle |
src/cluster_erp/modules/app_store/catalog.json (entry production), gated_apps/production/app.js:1275-1280 |
| Desktop presence | src/cluster_erp/desktop/modules/production/ (scheduling_board.py) |
folder |
What the module does¶
- Keeps work centers with parallel capacity units, working hours, a time zone, an owning organisation, and declared operation-type capabilities (
src/cluster_erp/modules/production/work_centers/models.py:25-151). - Keeps routings per product breakdown, with operations, prep operations, and component allocations, and derives them from the BOM with the scaffold wizard (
src/cluster_erp/modules/production/routings/scaffold.py:1-43). - Creates production orders that explode the BOM into components and copy the routing into operations (
src/cluster_erp/modules/production/production_orders/services.py:147-438). - Splits orders into work orders and executes them (
src/cluster_erp/modules/production/work_orders/services.py:39-47). - Places work orders on a calendar-aware scheduling board and computes capacity load (
src/cluster_erp/modules/production/scheduling/services.py:1,src/cluster_erp/modules/production/capacity/services.py:1-16).
Sub-modules¶
| Sub-module | Purpose | Main entities | Router | Source |
|---|---|---|---|---|
work_centers |
Work centers, hours, capabilities | WorkCenter, WorkCenterHours, WorkCenterOperationType |
/work-centers |
src/cluster_erp/modules/production/work_centers/routes.py:22 |
capacity |
Capacity load and input-output | none | /capacity |
src/cluster_erp/modules/production/capacity/routes.py:15 |
operation_types |
Operation type catalogue | OperationType |
/operation-types |
src/cluster_erp/modules/production/operation_types/routes.py:23 |
routings |
Routings, operations, prep, scaffold | Routing, RoutingOperation, PrepOperation |
/routings |
src/cluster_erp/modules/production/routings/routes.py:38 |
routing_templates |
Templates and cut technology rules | RoutingTemplate, RoutingTemplateOp, CutTechnologyRule |
/routing-templates and a rules router |
src/cluster_erp/modules/production/routing_templates/routes.py:29-35 |
component_allocations |
BOM items and other inputs per operation | ComponentAllocation |
component allocation router | src/cluster_erp/modules/production/component_allocations/routes.py:23-29 |
production_orders |
Orders, components, operations | ProductionOrder, ProductionOrderComponent, ProductionOrderOperation |
/production-orders |
src/cluster_erp/modules/production/production_orders/routes.py:34 |
production_versions |
Valid BOM and routing pairs per breakdown | ProductionVersion |
/production-versions |
src/cluster_erp/modules/production/production_versions/routes.py:34 |
work_orders |
Work orders | WorkOrder |
/work-orders |
src/cluster_erp/modules/production/work_orders/routes.py:23 |
scheduling |
Scheduling board read model and writes | none | /scheduling |
src/cluster_erp/modules/production/scheduling/routes.py:32 |
Data model¶
Fields are listed on the sub-topic pages. Routings, production orders, components, and production versions carry product_id, product_model_id, and product_version_id (src/cluster_erp/modules/production/routings/models.py:18-34, src/cluster_erp/modules/production/production_orders/models.py:23-40). Labour and overhead rates are Numeric(12, 4) (src/cluster_erp/modules/production/work_centers/models.py:45-46).
Screens and metadata¶
get_metadata declares a sidebar group Production (Turkish Üretim) with Scheduling Board, Production Orders, Work Orders, Routings, Component Allocations, Work Centers, Operation Types, Routing Templates, Cut Technology Rules, Capacity (CRP), and Production Versions, and a home widget Scheduling (src/cluster_erp/modules/production/module.py:2516-2650). The work center card has a capability checklist and a working calendar tab (src/cluster_erp/modules/production/module.py:1356-1366). See gated app bundles and desktop module screens.
Status and actions¶
The module declares no ActionMeta; status changes go through routes such as POST /routings/{routing_id}/status, POST /production-orders/{order_id}/status, and POST /work-orders/{work_order_id}/start (src/cluster_erp/modules/production/routings/routes.py:373, src/cluster_erp/modules/production/production_orders/routes.py:205, src/cluster_erp/modules/production/work_orders/routes.py:112). The status machines are on the sub-topic pages.
Business rules¶
Each sub-topic page lists its rules. Order numbers come from the yearly sequence production_order (src/cluster_erp/modules/production/production_orders/services.py:165).
Events and queries¶
The module consumes 17 contracts and produces 29, counted as on the parties module page. The full list is on the contracts reference.
| Direction | Contract class | Handler or emitter | Source |
|---|---|---|---|
| emits | ProductionOrderCreated, ProductionOrderStatusChanged, ProductionOrderCancelled, ProductionOrderOnHold, ProductionOrderCompleted, MaterialConsumed |
ProductionOrderService |
src/cluster_erp/modules/production/production_orders/services.py:227-812 |
| emits | WorkOrderCompleted |
WorkOrderService |
src/cluster_erp/modules/production/work_orders/services.py:405 |
| answers query | GetProductionOrderById, GetRoutingForProduct, GetOpenProductionDemand, GetProductionSupply, GetComponentAllocations, CreateProductionOrderForProject, CreateProductionOrderFromPlanned, GetProjectProductionSchedule, GetProductionVersionsBulk, CheckProductionCapacity, GetProjectProductionRollup, GetProjectProductionEvm |
handlers in module.py |
src/cluster_erp/modules/production/module.py:129-177 |
| subscribes | ProjectSchedulePublished |
_on_project_schedule_published, which stamps schedule_stale_at on the project's orders |
src/cluster_erp/modules/production/module.py:180, src/cluster_erp/modules/production/module.py:225-248 |
| subscribes | WorkingCalendarChanged |
_on_calendar_changed, which marks scheduled work orders stale |
src/cluster_erp/modules/production/module.py:183, src/cluster_erp/modules/production/module.py:1119-1138 |
| subscribes | BomVersionActivated |
_on_bom_version_activated, which marks live routings of the breakdown stale |
src/cluster_erp/modules/production/module.py:184, src/cluster_erp/modules/production/module.py:195-224 |
| subscribes | DescribeFieldConsumers, DescribeAnalyticsFacts |
tenant fields and analytics | src/cluster_erp/modules/production/module.py:108, src/cluster_erp/modules/production/module.py:193 |
Permissions¶
The module checks work_center.*, routing.*, routing_template.*, routing_template_op.*, cut_technology_rule.*, production_order.*, and work_order.*. Operation types, component allocations, and production versions use the routing.* keys, and capacity reads use production_order.read (src/cluster_erp/modules/production/operation_types/routes.py:26-121, src/cluster_erp/modules/production/production_versions/routes.py:87-233, src/cluster_erp/modules/production/capacity/routes.py:18-34).
Privacy, retention, and history¶
The module has no privacy_handlers.py. Deletes set deleted_at (src/cluster_erp/modules/production/work_centers/services.py:102-108). Changes are captured by change history.
Analytics facts¶
analytics_facts.py contributes the fact set production_order over production_production_orders with the measures order_count, total_qty_planned, total_qty_produced, and total_qty_scrapped, read with production_order.read (src/cluster_erp/modules/production/analytics_facts.py:20-103). See analytics facts.
Settings and reference data¶
Operation types can be seeded from a list of 41 defaults in code with POST /operation-types/seed-defaults (src/cluster_erp/modules/production/operation_types/services.py:21, src/cluster_erp/modules/production/operation_types/routes.py:121). Working calendars come from the calendars module.
Tests¶
Found by a grep for modules.production in tests/ and for the path /production/ in web-client/_e2e_*.mjs.
| Kind | File | Covers |
|---|---|---|
| pytest | tests/test_scheduling_calendar.py, tests/test_scheduling_calendar_chain.py |
calendar-aware scheduling and the calendar owner chain |
| pytest | tests/test_scheduling_capacity_units.py |
parallel capacity units |
| pytest | tests/test_board_calendar_chain.py |
board and calendar chain |
| e2e | web-client/_e2e_production_app.mjs |
the production app |
| e2e | web-client/_e2e_ebom_scaffold.mjs, web-client/_e2e_ebom_wizard.mjs, web-client/_e2e_ebom_operation_staging.mjs |
the routing scaffold |
| e2e | web-client/_e2e_capacity_cap.mjs, web-client/_e2e_capacity_units.mjs, web-client/_e2e_mrp_capacity_faz3.mjs |
capacity |
Discrepancies¶
Terms introduced¶
| Term | Code identifier | Definition | Turkish term | Source |
|---|---|---|---|---|
| work center | WorkCenter |
A place or resource where operations run, with capacity and hours. | İş merkezi | src/cluster_erp/modules/production/work_centers/models.py:25 |
| production order | ProductionOrder |
An order to make a quantity of one product breakdown. | Üretim emri | src/cluster_erp/modules/production/production_orders/models.py:14 |
| work order | WorkOrder |
The execution unit of one operation of a production order. | İş emri | src/cluster_erp/modules/production/work_orders/models.py:14 |
Related pages¶
- Modules index
- Work centers and capacity
- Routings and operation types
- Production orders and versions
- Work orders
- Scheduling
- BOM module
- API reference for this module
Verified against commit 92f8051 on 2026-11-13.