Work Orders
A Work Order tells the factory to produce a specific quantity of a finished product — optionally from an approved Bill of Materials, on a chosen work center, by a planned start/end date, at a set priority — and tracks that job step-by-step across the shop floor.
production/MfgWorkOrders). Every action on
this screen requires the module_manufacturing module to be enabled and the
manufacturing_work_order permission — see
Permissions & Roles.
What a Work Order does
Think of a Work Order (WO) as one run of production. It carries the what (product and quantity), the from what (an approved Bill of Materials), the where (a primary Work Center), and the when (planned start/end dates and a priority). Underneath it holds a routing of Operations — the individual production steps such as cutting, assembly, and packaging — that supervisors and operators start and complete one at a time, recording actual run time and completed / scrapped quantities.
The order moves through a lifecycle (Draft → Released → In Progress → Completed, or Cancelled) using dedicated Release, Start, and Complete buttons. Its detail page shows overall progress plus any labor time booked against it.
The four screens
The feature is made of four connected pages. Use the gear menu on each list row to move between them.
| Screen | Route | What it is for |
|---|---|---|
| Work Orders List | production/MfgWorkOrders |
Landing page — a DataTable of all orders (default sort: Order # descending) with a New Work Order button and Status / Priority filter dropdowns. Columns can be exported to Excel. |
| New / Edit Work Order | .../modal_form |
Modal popup form to create or edit an order. On a new record it pre-fills the auto-generated next Order #. |
| Work Order Detail | .../view/{id} |
Read-only detail: header summary, lifecycle action buttons, the operations routing table, the overall progress bar, and any labor records. |
| Operations Management | .../operations/{order_id} |
Manage the routing: add operations with an inline form, and start / complete / delete existing operations from the table. |
List columns
The Work Orders list shows these columns; the first nine (0–8) are what Excel export captures.
| Column | Shows |
|---|---|
| Order # | The unique work-order number (e.g. WO-000001). |
| Product | The finished good's name. |
| BOM | The linked BOM's bom_code, or blank if none. |
| Priority | Coloured priority badge (Low / Normal / High / Urgent). |
| Quantity | Ordered quantity with a progress bar (quantity_produced / quantity_ordered). |
| Progress | Completion bar for the order. |
| Start Date | Planned start, or - if blank. |
| End Date | Planned end, or - if blank. |
| Status | Coloured status badge (Draft / Released / In Progress / Completed / Cancelled). |
| Actions | Gear menu: View, Operations, (divider), Edit, Delete. |
quantity_produced / quantity_ordered, but the detail page bar uses
completed operations / total operations. Completing operations does not roll up into
quantity_produced in this UI, so the list bar can stay at 0% even after operations are
done. Read progress on the detail page for an operation-accurate figure.
Work Order fields
These fields appear on the New / Edit Work Order modal form. Every dropdown is a Select2 — begin typing to filter the options.
| Field | Meaning | Required | Notes |
|---|---|---|---|
order_number — Order # |
Unique identifier of the work order. | Required | On a new order it is auto-filled with the next number (prefix from the
work_order_number_prefix setting, default WO, plus a 6-digit
zero-padded sequence, e.g. WO-000002). Editable text; must be unique. |
product_name — Product |
Name of the finished good being manufactured. | Required | Free-text input, placeholder Product Name. |
bom_id — BOM |
The Bill of Materials this order is built from. | Optional | Select2 sourced only from BOMs with status approved; each option reads
bom_code - product_name. Saved as NULL if left blank. |
quantity_ordered — Quantity |
How many units to produce. | Required | Numeric input, step 0.01. Drives the list progress bar. |
uom_id — UOM |
Unit of measure the quantity is expressed in. | Required | Select2 sourced from active units; each option reads name (symbol). The required rule applies to the hidden Select2 element. |
work_center_id — Work Center |
The primary production resource / machine / station for the order. | Optional | Select2 sourced from active work centers; each option reads code - name. Saved
NULL if blank. |
priority — Priority |
Urgency of the order for scheduling. | Optional | Select2: Low / Normal / High / Urgent. Defaults to Normal. |
planned_start_date — Planned Start |
Scheduled date production should begin. | Optional | Date picker. Saved NULL if blank; shown as - in the list and
TBD on the detail page when empty. |
planned_end_date — End |
Scheduled date production should finish. | Optional | Date picker (labelled End). Saved NULL if blank. |
status — Status |
Current lifecycle state of the order. | Optional | Select2: Draft / Released / In Progress / Completed / Cancelled. Defaults to Draft. Editable here, but normally advanced via the lifecycle buttons. |
notes — Notes |
Free-form remarks about the order. | Optional | Textarea, 3 rows. Warning: cancelling an order overwrites this field with the cancel reason. |
System & hidden fields
These are set by ERPat or accepted on save but not shown as inputs in the modal form.
| Field | Meaning | Required | Notes |
|---|---|---|---|
quantity_produced — Completed |
Good units produced so far. | System | Read-only; shown in the list Quantity bar and as Completed on detail. Defaults 0 and is not updated by completing operations in this UI. |
quantity_scrapped |
Rejected units at order level. | System | Column exists (default 0); not edited from this Work Orders UI. |
actual_start_date |
Timestamp production actually started. | System | Set automatically to the current UTC time when Start is clicked. |
actual_end_date |
Timestamp production actually finished. | System | Set automatically to the current UTC time when Complete is clicked. |
product_id |
Internal link to the items / products table. | Optional | Not shown as an input; posted only if present, saved NULL otherwise. |
sales_order_id |
Reference to a sales order if production is customer-driven. | Optional | Not exposed in the modal UI; accepted on save if posted, else NULL. |
customer_id |
Reference to the customer the order is for. | Optional | Not exposed in the modal UI; accepted on save if posted, else NULL. |
Order lifecycle
A Work Order advances through five states. The normal path uses the state-gated buttons on the detail page; Cancelled is a terminal side-exit.
Priority legend
Priority controls how you sort and triage the queue. It does not change any automatic behaviour.
Operations & routing
Every Work Order carries a routing — an ordered list of Operations (production steps).
You build and run the routing on the Operations Management page
(.../operations/{order_id}), reached from the gear menu's Operations item or the
detail page. The order's detail-page progress bar is computed from
completed operations / total operations, so the routing is what drives visible progress.
An inline Add Operation form sits above the operations table. Fill it in and click Add Operation — the new step is added as Pending and the form resets.
| Field | Meaning | Required | Notes |
|---|---|---|---|
operation_number — # |
Sequence number that orders operations in the routing. | Defaults 10 | Defaults to 10; if left blank on save it becomes 10. The list sorts ascending by this number. |
operation_name — Operation Name |
Name of the production step (e.g. Cutting, Assembly). | Required | Placeholder Operation Name *. |
work_center_id — Work Center |
Resource where this specific step is performed. | Optional | Select2 from active work centers; saved NULL if blank. |
setup_time_minutes_planned — Setup |
Planned setup time in minutes for the operation. | Defaults 0 | Number input, placeholder Setup. Displayed as N min. |
run_time_minutes_planned — Runtime |
Planned run time in minutes for the operation. | Defaults 0 | Number input, step 0.01, placeholder Runtime. Shown formatted to 2 decimals + min. |
On the operations table, each step's gear menu offers actions gated by its status: Start (Pending only), Complete (In Progress only), a divider, and Delete.
- Start stamps
actual_start_dateand moves the step to In Progress. - Complete stamps
actual_end_date, records the completed and scrapped quantities you supply, and auto-computes actual runtime asround((now − actual_start_date) / 60, 2)minutes — only if the step was started first.
| Field | Meaning | Required | Notes |
|---|---|---|---|
run_time_minutes_actual — Actual |
Actual run time in minutes. | System | Auto-computed on Complete from the start-to-complete elapsed time; requires the operation to have been started. |
quantity_completed — Completed |
Good quantity completed at this operation. | On complete | Posted on Complete (default 0). Shown as completed / scrapped. |
quantity_scrapped — Scrap |
Scrapped quantity at this operation. | On complete | Posted on Complete (default 0). |
notes — Notes (operation) |
Remarks for the operation. | Optional | Accepted on save; no dedicated input is rendered in the inline add row. |
Operations table columns
Both the detail-page (read-only) operations table and the operations-management table show these columns. An empty routing displays No operations.
| Column | Shows |
|---|---|
| # | Operation number (ascending sort order). |
| Operation | Operation name. |
| Work Center | The step's work center (code - name), if set. |
| Setup | Planned setup minutes. |
| Planned | Planned run time (minutes). |
| Actual | Auto-computed actual run time. |
| Completed/Scrap | Good vs. scrapped quantity for the step. |
| Status | Operation status badge. |
| Actions | (Operations page only) Start / Complete / Delete. |
Operation lifecycle
actual_start_date set. Advances to Completed.quantity_completed and quantity_scrapped default to 0 unless your
deployment adds a prompt. And because Complete only appears for In Progress steps, you must
Start an operation before you can complete it — otherwise the actual runtime cannot be
computed.
The detail page
Open an order with View to see its read-only detail. The header title reads ORDER# - Product, followed by context-sensitive lifecycle buttons and two info rows.
| Section | What you see |
|---|---|
| Lifecycle buttons | Release (Draft only), Start (Released only), Complete (In Progress only), plus Back. |
| Header info | Order #, BOM, Priority badge, Status badge. |
| Second info row | Planned Qty (with UOM), Completed qty, planned Start, planned End (each shows TBD if blank). |
| Overall Progress | A bar computed from completed operations / total operations. |
| Operations table | Read-only routing (see columns above). |
| Labor Records | Only shown if labor exists: Worker, Type, Start, End (Active if not yet clocked out), Hours, Rate. |
Actions & permissions
Every action below is gated by the single manufacturing_work_order permission and
requires the manufacturing module to be enabled.
| Action | Effect | Confirmation |
|---|---|---|
| New Work Order | Opens the modal with a blank form and a pre-generated next Order #. | — |
| Save | Creates or updates the order. On create sets uuid, created_by, created_at; always sets updated_at. Defaults Priority = Normal, Status = Draft if blank. | Success: The record has been saved. |
| View | Opens the read-only detail page. | — |
| Operations | Opens the operations-management page for the order. | — |
| Edit | Opens the modal pre-filled with the order's data. | — |
| Delete | Soft-deletes the order (deleted = 1). | Standard delete-confirmation dialog. Success: The record has been deleted. |
| Release (Draft only) | Sets status = Released. Internally calls confirm_order. | Browser confirm Confirm this order? → success Order confirmed, page reloads. |
| Start (Released only) | Sets status = In Progress and stamps actual start. | No dialog — runs immediately. Success Order started, page reloads. |
| Complete (In Progress only) | Sets status = Completed and stamps actual end. | Browser confirm Mark this order as completed? → success Order completed, page reloads. |
| Cancel (endpoint only) | Sets status = Cancelled and overwrites Notes with the cancel reason. | Success Order cancelled. No wired button in the current views. |
| Add Operation | Inserts a routing step as Pending; appends it to the table and resets the form. | — |
| Start (operation) | Sets operation In Progress, stamps actual start. Pending steps only. | No dialog. Success Operation started. |
| Complete (operation) | Sets operation Completed, records completed/scrap qty and computes actual runtime. In Progress steps only. | No dialog. Success Operation completed. |
| Delete (operation) | Soft-deletes the operation (deleted = 1). | Delete-confirmation dialog. Success The record has been deleted. |
| Back / Back to Order | Returns to the list (from detail) or to the order detail (from operations). | — |
Permission keys
The controller gates every action on the base key manufacturing_work_order
(category Manufacturing: Work Orders, action Manage Work Orders). The
_create, _update, and _delete keys are declared for granular
role configuration. The manufacturing module must be enabled or the user is redirected.
See the full matrix in Permissions & Roles.
notes = cancel_reason, overwriting anything previously typed in the Notes field.
There is currently no wired Cancel button in these screens — cancel_order exists
only as an endpoint.
Validation & messages
The Save form enforces these rules; a missing required field shows This field is required. beneath it.
| Rule set | Requirements |
|---|---|
| Save work order | id numeric; order_number required; product_name required; quantity_ordered required & numeric; uom_id required & numeric. |
| Save operation | order_id required & numeric; operation_name required. |
| Lifecycle & operation actions | id required & numeric. |
SOP — Create and run a work order
manufacturing_work_order permission to whoever performs each step.
-
Planner — create the order
Go to Manufacturing → Work Orders and click New Work Order (the Order # is pre-filled, e.g.
WO-000002). Enter the Product name; optionally pick an approved BOM; enter Quantity and choose the UOM (both required). Optionally set Work Center, Priority, and Planned Start / End. Leave Status as Draft, add Notes if needed, then Save. The order appears with a grey Draft badge at 0% progress. -
Supervisor — build the routing
From the list gear menu, open Operations. In the inline Add row set the operation number (default 10), type an Operation Name (e.g. Cutting), pick the Work Center, and enter planned Setup and Runtime minutes. Click Add Operation — the step is added as Pending. Repeat with 20, 30, … for each subsequent step.
-
Supervisor — release the order
Open the order detail (View). While Draft, click Release and confirm the dialog.
⚠️Browser confirm: Confirm this order? — accepting moves the status to Released. -
Supervisor — start production
With the order Released, click Start. There is no confirmation; the status becomes In Progress and the actual start time is stamped immediately.
-
Operator — run each operation
On the Operations page, for each Pending step click Start, do the work, then click Complete — supplying the completed and scrapped quantities. Each completed step turns green and the order's overall progress bar advances. Book any time worked in Labor Tracking; run any required checks in Quality Control.
-
Supervisor — close out the order
When all operations are Completed, open the order detail and click Complete.
⚠️Browser confirm: Mark this order as completed? — accepting sets the status to Completed, stamps the actual end time, and removes the lifecycle buttons.
Before you create work orders
Line up these prerequisites so the dropdowns aren't empty and the module is reachable.
Enable the module
The manufacturing module must be on (Settings → Manage Modules) or access redirects.
Grant the permission
The user's role must grant
manufacturing_work_order.Have active UOMs
Active Units of Measure (Piece, Kilogram, Liter, …) must exist so a UOM can be selected.
Approve a BOM (optional)
To link a BOM, at least one BOM must be approved — only approved BOMs appear in the dropdown.
Have active Work Centers
To assign work centers to the order or its operations, active Work Centers must exist.
Set the number prefix (optional)
Optionally set
work_order_number_prefix(defaultWO) in Manufacturing Settings.
Gotchas to remember
confirm_order endpoint. "Release" and "Confirm" both mean Draft → Released — the success flash even reads Order confirmed.quantity_produced / quantity_ordered; the detail bar uses completed operations / total operations. Because quantity_produced is never updated by completing operations here, the list bar can read 0% even when the routing is done.approved BOMs; a draft, pending-approval, or obsolete BOM will not appear. Likewise only active UOMs and active Work Centers show up in their dropdowns.deleted = 1 — records are never physically removed, and Order # uniqueness is scoped by (order_number, deleted). All timestamps are handled in UTC; planned dates are simple date pickers while actual start/end are full timestamps.Related pages
Approve a BOM so it can be attached to a work order.
The resources where operations run.
Time booked against an order, shown on its detail page.
Inspections, NCR and CAPA on produced output.
Request and issue the components a work order needs.
The simpler Base Production order (a separate table).
manufacturing_work_orders table. A separate, simpler
Manufacturing Orders table
(manufacturing_orders) exists from an earlier Base Production migration and is not
used by this controller — don't confuse the two.