W075: Bulk-import materials
Creates many materials at once from an uploaded CSV or Excel file. Triggered from the Data page, Materials import. Atomic.
Steps
-
Parse the upload. Collect parse errors into a list.
-
Abort on parse failures. Raise a
ValidationError. -
Create each material inside one transaction. For each parsed row, run W065 steps 1 to 3.
-
Commit. Any single-row failure rolls the whole batch back.
Returns
The list of created material ids.
Business rules
- All or nothing.
Errors
ValidationError. Parse failures or any single row failing the Create Material rules.