W143: Bulk-import work orders
Creates many WOs at once from an uploaded CSV or Excel file. Triggered from the Data page, WO import. Atomic; all rows succeed or none do.
Steps
-
Parse the upload. Read the file into rows of
{ header, items[] }. Collect parse errors into a list. -
Abort on parse failures. If any rows failed to parse, raise a
ValidationError. -
Create each WO inside one transaction. Open
withTransaction. For each parsed row, run the Create WO flow (W129) steps 1 to 7. The step-7 reconciliation projector seeds FGORDER/DEMAND/ALLOCATEledger entries per the row's initial status (nothing for aDraftrow). -
Commit. Any failure rolls the whole batch back.
Returns
The list of created WO numbers.
Business rules
- All or nothing. Atomic import.
Errors
ValidationError. Parse failures or any single row failing the Create WO rules.