Reference for the shipments sub-module of sales_orders, with shipment, line, unit, package, and event fields, statuses, dispatch checks, POD, and order roll-up.
This page describes the shipments sub-module of src/cluster_erp/modules/sales_orders/. A shipment (SalesOrderShipment) dispatches quantities of order lines and individual units of one sales order. It carries packages, transport data, a timeline of events, and the proof of delivery (POD). Each dispatch and delivery rolls the order status up. Generated documents are described on trade documents.
In prose: a shipment is planned, optionally readied, and then dispatched. A dispatched shipment goes in transit and is delivered. Before dispatch it can be put on hold, resumed to planned, or cancelled. The header and content change only in planned, packed, ready_to_ship, or on_hold (src/cluster_erp/modules/sales_orders/shipments/services.py:75-78). The status packed is kept only as a legacy value for older rows; no code sets it (src/cluster_erp/modules/sales_orders/shipments/schemas.py:25).
dispatch_checks returns errors and warnings by level: none, transport (a plate, or a carrier with a tracking number), or export (transport plus packages that are measured and weighed, net not above gross, and every item packed). A missing HS code or country of origin on a product is a warning (src/cluster_erp/modules/sales_orders/shipments/services.py:102-192).
Dispatch uses the tenant's dispatch_check_level and refuses on any error; the units become shipped (src/cluster_erp/modules/sales_orders/shipments/services.py:558-580, src/cluster_erp/modules/sales_orders/shipments/services.py:1106-1126).
A shipped quantity may not exceed the ordered quantity minus what other shipments already took (src/cluster_erp/modules/sales_orders/shipments/services.py:679-750).
A unit can join a shipment only while it is open or ready (src/cluster_erp/modules/sales_orders/shipments/services.py:799-839).
A package's volume in cubic metres is length times width times height, converted with the dimension unit's factor to the metre; any missing piece gives no volume (src/cluster_erp/modules/sales_orders/shipments/services.py:79-100).
Delivery without POD data is refused when the setting pod_rule is block, and logged as the event delivered_without_pod when it is warn (src/cluster_erp/modules/sales_orders/shipments/services.py:1148-1191).
Cancel returns the units to open (src/cluster_erp/modules/sales_orders/shipments/services.py:1218-1238).
A change to a shipment marks its generated documents stale (src/cluster_erp/modules/sales_orders/shipments/services.py:1239-1252).
The order roll-up marks a line shipped or delivered once its cumulative shipped quantity reaches the ordered quantity, and the order partially_shipped, shipped, or delivered accordingly; it emits SalesOrderPartiallyShipped, SalesOrderShipped, or SalesOrderDelivered (src/cluster_erp/modules/sales_orders/shipments/services.py:1253-1392).
Manual events are eta_update, location_update, or note (src/cluster_erp/modules/sales_orders/shipments/schemas.py:257).
Dispatch does not post a goods movement: a grep for PostGoodsIssue in src/cluster_erp/modules/sales_orders/ finds no call.