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

Reference

Sales order units and settings

Reference for the units and settings sub-modules of sales_orders, with unit fields and uniqueness, unit generation, and the per-tenant order chain settings.

This page describes two sub-modules of src/cluster_erp/modules/sales_orders/. units/ keeps the individual pieces (units, also called assets) ordered on an order line, with the customer's asset number and the company's serial number. settings/ keeps one row of settings per tenant for the order, shipment, and document chain. Shipments that carry units are described on shipments.

Scope and source

  • Defined in: units/models.py (SalesOrderUnit), units/services.py, units/routes.py, settings/models.py (SalesOrderSettings), settings/services.py, settings/schemas.py, and settings/routes.py.
  • Count: 2 tables; 5 unit routes and 3 settings routes (@router. decorators).

Unit fields

Name Meaning Source
code Business key from the yearly sequence sales_order_unit src/cluster_erp/modules/sales_orders/units/models.py:41, src/cluster_erp/modules/sales_orders/units/services.py:225
sales_order_id, sales_order_line_id, customer_id, project_id The order, line, customer, and project of the unit src/cluster_erp/modules/sales_orders/units/models.py:42-60
customer_asset_no The customer's asset number as on their PO src/cluster_erp/modules/sales_orders/units/models.py:61
serial_no, serial_number_id The company's serial number and its inventory serial record src/cluster_erp/modules/sales_orders/units/models.py:62-64
status open, ready, shipped, delivered, or cancelled src/cluster_erp/modules/sales_orders/units/models.py:11, src/cluster_erp/modules/sales_orders/units/models.py:65-67
notes Notes src/cluster_erp/modules/sales_orders/units/models.py:68

Unit routes

Method and path Permission Source
GET /sales-orders/units/, GET /sales-orders/units/{unit_id} sales_order_unit.read src/cluster_erp/modules/sales_orders/units/routes.py:24, src/cluster_erp/modules/sales_orders/units/routes.py:86
POST /sales-orders/lines/{line_id}/units sales_order_unit.create src/cluster_erp/modules/sales_orders/units/routes.py:56
POST /sales-orders/lines/{line_id}/generate-units sales_order_unit.create src/cluster_erp/modules/sales_orders/units/routes.py:70
PUT /sales-orders/units/{unit_id} sales_order_unit.update src/cluster_erp/modules/sales_orders/units/routes.py:99

Settings fields

Name Default Meaning Source
internal_order_no_enabled true Whether the internal order number shows on screens; it is minted either way src/cluster_erp/modules/sales_orders/settings/models.py:29-36
packing_list_no_template, delivery_note_no_template PL-{shipment_code}, DN-{shipment_code} Document number templates src/cluster_erp/modules/sales_orders/settings/models.py:35-44
pod_rule warn Delivery without proof of delivery: off, warn, or block src/cluster_erp/modules/sales_orders/settings/models.py:45-51, src/cluster_erp/modules/sales_orders/settings/schemas.py:9
dispatch_check_level transport What a dispatch must carry: none, transport, or export src/cluster_erp/modules/sales_orders/settings/models.py:49-54, src/cluster_erp/modules/sales_orders/settings/schemas.py:10
default_weight_unit_id, default_dimension_unit_id, default_package_type none Package defaults src/cluster_erp/modules/sales_orders/settings/models.py:55-61
document_language en Language of the packing list and delivery note src/cluster_erp/modules/sales_orders/settings/models.py:62-66

Settings routes

Method and path Permission Source
GET /settings/chain/ sales_order_settings.read src/cluster_erp/modules/sales_orders/settings/routes.py:19
GET /settings/chain/{settings_id} sales_order_settings.read src/cluster_erp/modules/sales_orders/settings/routes.py:30
PATCH /settings/chain/{settings_id} sales_order_settings.update src/cluster_erp/modules/sales_orders/settings/routes.py:44

Constraints and validation

  • A customer never gets the same asset number twice, and a serial number exists once, both among live rows (src/cluster_erp/modules/sales_orders/units/models.py:24-39, src/cluster_erp/modules/sales_orders/units/services.py:169-197).
  • A line cannot have more live units than its quantity; generate-units creates the remaining units, numbering asset numbers from a start value when given (src/cluster_erp/modules/sales_orders/units/services.py:198-272).
  • The identifiers of a shipped or delivered unit are frozen because they are printed on issued documents (src/cluster_erp/modules/sales_orders/units/services.py:35, src/cluster_erp/modules/sales_orders/units/services.py:274-290).
  • The settings row is created on first read; an update must address that row, checks the record version, and validates number templates (src/cluster_erp/modules/sales_orders/settings/services.py:56-96).
  • The setting internal_order_no_enabled is offered to the platform as a display switch through DescribeDisplaySwitches (src/cluster_erp/modules/sales_orders/settings/services.py:97-100, src/cluster_erp/modules/sales_orders/module.py:108-110).

Terms introduced

Term Code identifier Definition Turkish term Source
unit (asset) SalesOrderUnit One physical, individually identified piece ordered on an order line. Birim (asset) src/cluster_erp/modules/sales_orders/units/models.py:14
customer asset number customer_asset_no The customer's number for a unit as it appears on their PO. Müşteri varlık numarası src/cluster_erp/modules/sales_orders/units/models.py:61
POD rule pod_rule What the system does when a delivery is recorded without proof of delivery. POD kuralı src/cluster_erp/modules/sales_orders/settings/models.py:45-51

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

Verified against commit 92f8051 · 2026-11-13