Skip to main content

Update MO Operation

PUT 

/api/manufacturing/mo-operations/:moOperation

Update an MO operation. Allowed on both source='manual' AND source='from_bom' rows — edits to from_bom rows do NOT propagate back to the BOM master.

Required scope: manufacturing:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

All body fields are 'sometimes' (omit to leave unchanged):

  • sequence (integer, min 0)
  • name (string, max 255)
  • type (enum: process, setup, per_unit, fixed_cost) — maps to operation_type column
  • work_center_id (integer, exists:work_centers,id, nullable)
  • default_operator_id (integer, exists:users,id, nullable)
  • expected_duration_minutes (integer, min 0, nullable)
  • hourly_rate (numeric, min 0, nullable)
  • fixed_cost (numeric, min 0, nullable) — flat per-run cost added additively to labour. Changing it re-derives actual_cost as (time × rate) + fixed_cost.
  • notes (string, max 1000, nullable)

When the row is source='from_bom' and any of {sequence, name, operation_type, work_center_id, default_operator_id, expected_duration_minutes, hourly_rate, fixed_cost} now differs from the linked BOM operation, the response field is_modified_from_bom flips to true.

Refused with 422 {code:'mo_locked'} when MO status is completed | closed | cancelled.

The response also carries a cost_source field: 'none' (no actual_cost yet), 'actual' (cost backed by logged time, or a fixed_cost operation), 'estimated' (cost fell back to planned duration because no timer was logged), or 'manual' (an explicitly supplied actual_cost). Sending actual_cost in the body stamps cost_source='manual' and locks the cost against automatic re-derivation — rate, fixed-cost, or type edits no longer recompute it; only another explicit actual_cost (null clears both cost and source), or an explicitly logged positive time, replaces it.

cost_classification (optional, labor|overhead, default labor) sets the expense classification independently of the rate basis: labor posts the operation's variable cost to the Labor bucket (marked up by the work center's overhead %); overhead posts machine/tooling-style cost to the Overhead bucket with no additional markup.

Request

Responses

OK

Response Headers
    Content-Type