Factorizer/Cluster ERP WikiCluster ERP Türkçe
Home / Business modules

Reference

Production orders and versions

Reference for production_orders and production_versions in production, with order, component, and operation fields, statuses, material postings, and version selection.

This page describes two sub-modules of src/cluster_erp/modules/production/. A production order (ProductionOrder) makes a quantity of one product breakdown; it holds the components exploded from the BOM and the operations copied from the routing. A production version (ProductionVersion) names which BOM version and routing are valid for a breakdown in a date range and lot size range. Work orders that execute the operations are on work orders.

Scope and source

  • Defined in: production_orders/models.py, services.py (ProductionOrderService), routes.py, and production_versions/models.py, routes.py, metadata.py, plus the version handler in src/cluster_erp/modules/production/module.py:249-300.
  • Count: 4 tables; 17 production order routes and 4 production version routes (@router. decorators).
  • Component allocations (component_allocations/) belong to routing operations and are described on routings and operation types (src/cluster_erp/modules/production/component_allocations/models.py:14-24).

Order fields

Entity Table Key fields Source
ProductionOrder production_production_orders order_no (yearly sequence production_order), product_id, product_model_id, product_version_id, project_id, bom_version_id, routing_id, qty_planned, qty_produced, qty_scrapped, status (default planned), planned_start, planned_end, project_activity_ref, schedule_stale_at, actual_start, actual_end, priority, cancel_reason, hold_reason src/cluster_erp/modules/production/production_orders/models.py:14-107, src/cluster_erp/modules/production/production_orders/services.py:165
ProductionOrderComponent production_order_components product breakdown, qty_required, qty_consumed, warehouse_id, batch_id src/cluster_erp/modules/production/production_orders/models.py:110-153
ProductionOrderOperation production_order_operations operation_no, work_center_id, operation_type_code, description, setup_time_min, run_time_per_unit_min, run_time_total_min, scrap_pct, status (default pending), actual_setup_min, actual_run_min, qty_good, qty_scrap src/cluster_erp/modules/production/production_orders/models.py:156-225
ProductionVersion production_production_versions version_code, product breakdown, bom_version_id, routing_id, valid_from, valid_to, lot_size_min, lot_size_max, is_default, status (default active) src/cluster_erp/modules/production/production_versions/models.py:19-69

Quantities are Numeric(14, 4) (src/cluster_erp/modules/production/production_orders/models.py:55-68).

Order statuses

The service allows these transitions (src/cluster_erp/modules/production/production_orders/services.py:58-66).

stateDiagram-v2
 [*] --> planned
 planned --> released
 planned --> cancelled
 released --> in_progress
 released --> planned
 released --> on_hold
 released --> cancelled
 in_progress --> completed
 in_progress --> on_hold
 on_hold --> released
 on_hold --> in_progress
 on_hold --> cancelled
 completed --> closed

In prose: an order is planned, released, and started; it can be held and resumed, cancelled before it starts work, and closed after completion. Starting the first work order moves a released order to in_progress (src/cluster_erp/modules/production/work_orders/services.py:350-353).

Order routes

Method and path Permission Source
GET, POST /production-orders/; GET, PUT, DELETE /production-orders/{order_id}; POST /production-orders/bulk-delete production_order.read, .create, .update, .delete, .bulk_delete src/cluster_erp/modules/production/production_orders/routes.py:130-269
POST /production-orders/{order_id}/status, /complete, /cancel, /hold production_order.update src/cluster_erp/modules/production/production_orders/routes.py:205-244
POST /production-orders/{order_id}/consume-material production_order.update src/cluster_erp/modules/production/production_orders/routes.py:286
PUT .../operations/{operation_id}; POST, PUT, DELETE .../components production_order.update src/cluster_erp/modules/production/production_orders/routes.py:307-367
GET /production-orders/operations/all production_order.read src/cluster_erp/modules/production/production_orders/routes.py:42
POST /production-orders/{order_id}/generate-work-orders work_order.create src/cluster_erp/modules/production/production_orders/routes.py:102
GET, POST /production-versions/; PUT, DELETE /production-versions/{pv_id} routing.read, routing.create, routing.update src/cluster_erp/modules/production/production_versions/routes.py:87-233

Constraints and validation

  • Create asks IsProductManufacturable and refuses a product that cannot be made (src/cluster_erp/modules/production/production_orders/services.py:147-160).
  • Create explodes the BOM with GetBomExplosion into components, adds the stock material of a cut-from-stock part as its single component, and copies the routing's operations (src/cluster_erp/modules/production/production_orders/services.py:185-247, src/cluster_erp/modules/production/production_orders/services.py:311-438).
  • Completion posts a goods receipt of the finished product with PostGoodsReceipt before the order is marked completed, closes open work orders, and emits ProductionOrderCompleted (src/cluster_erp/modules/production/production_orders/services.py:637-729).
  • Material consumption is allowed in released or in_progress and posts PostGoodsIssue; an order of a project issues from the project stripe first (src/cluster_erp/modules/production/production_orders/services.py:730-826).
  • Only planned, closed, or cancelled orders can be deleted; delete cascades to work orders (src/cluster_erp/modules/production/production_orders/services.py:856-891).
  • ProjectSchedulePublished stamps schedule_stale_at on the project's orders (src/cluster_erp/modules/production/module.py:225-248).
  • GetProductionVersionsBulk returns, per breakdown, the active version valid on the date, the default first and then the earliest valid_from (src/cluster_erp/modules/production/module.py:249-300).

Discrepancies

Terms introduced

Term Code identifier Definition Turkish term Source
production version ProductionVersion The valid pair of BOM version and routing for a breakdown, with dates and lot sizes. Üretim versiyonu src/cluster_erp/modules/production/production_versions/models.py:19
order component ProductionOrderComponent A material the order needs, with required and consumed quantity. Emir bileşeni src/cluster_erp/modules/production/production_orders/models.py:110
order operation ProductionOrderOperation An operation copied from the routing onto the order. Emir operasyonu src/cluster_erp/modules/production/production_orders/models.py:156

Verified against commit 92f8051 on 2026-11-13.

Verified against commit 92f8051 · 2026-11-13