feat(jobs): Sub 14 — configurable workflow state bar (Path B)

Replaces the generic Draft/Confirmed/In Progress/Done statusbar with
a shop-configurable list of plating-specific milestones. Bar advances
automatically as recipe steps complete; no manual button clicks.

What ships
==========

* New model: fp.job.workflow.state
  Catalog of milestones (name, code, sequence, color, triggers).
  Triggers can be:
    - trigger_default_kinds: "receiving,inspect" matches by step.default_kind
    - trigger_first_step_started: any wet/bake/mask/rack step started
    - trigger_all_steps_done: every non-cancelled step in done/skipped
    - block_when_quality_hold: held back while NCR/hold open
  Plus per-recipe-node override (see below).

* Default 7-state seed (data/fp_workflow_state_data.xml):
    Draft → Confirmed → Received → In Progress → Inspected → Shipped → Done
  noupdate=1 so per-shop edits survive module upgrade.

* Recipe-side trigger field on fusion.plating.process.node:
    triggers_workflow_state_id (Many2one, optional)
  Wins over default_kind matching. Lets the recipe author pin a
  specific step as a milestone trigger even when default_kind isn't
  set or doesn't match. Exposed in the Recipe Tree Editor properties
  panel (dropdown sourced from the catalog).

* fp.job.workflow_state_id (computed, stored)
  Iterates the catalog in sequence order; lands at the highest passed
  milestone. Recomputes on step state / kind / recipe_node / quality
  hold changes. Replaces fp.job.state on the form's statusbar.

* Settings UI: Configuration > Workflow States
  Standard list+form pages so admins can add / edit / deactivate
  states. Manager-group write permission, supervisor read.

What this does NOT do
=====================
  * Doesn't drop fp.job.state — that field still drives the internal
    state machine (button_confirm, action_cancel, etc.). Only the
    UI statusbar is reassigned.
  * No migration for existing jobs — they auto-recompute on next read
    because workflow_state_id is a stored compute with the right
    api.depends. Existing WH/JOB/00342 will display its current
    workflow state on next page load.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-03 23:39:38 -04:00
parent 4c6bad04c5
commit 4e0b74d7ae
12 changed files with 564 additions and 2 deletions

View File

@@ -17,3 +17,6 @@ access_fp_job_step_input_wiz_mgr,fp.job.step.input.wiz.manager,model_fp_job_step
access_fp_job_step_input_wiz_l_op,fp.job.step.input.wiz.l.operator,model_fp_job_step_input_wizard_line,fusion_plating.group_fusion_plating_operator,1,1,1,1
access_fp_job_step_input_wiz_l_sup,fp.job.step.input.wiz.l.supervisor,model_fp_job_step_input_wizard_line,fusion_plating.group_fusion_plating_supervisor,1,1,1,1
access_fp_job_step_input_wiz_l_mgr,fp.job.step.input.wiz.l.manager,model_fp_job_step_input_wizard_line,fusion_plating.group_fusion_plating_manager,1,1,1,1
access_fp_workflow_state_op,fp.workflow.state.operator,model_fp_job_workflow_state,fusion_plating.group_fusion_plating_operator,1,0,0,0
access_fp_workflow_state_sup,fp.workflow.state.supervisor,model_fp_job_workflow_state,fusion_plating.group_fusion_plating_supervisor,1,0,0,0
access_fp_workflow_state_mgr,fp.workflow.state.manager,model_fp_job_workflow_state,fusion_plating.group_fusion_plating_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
17 access_fp_job_step_input_wiz_l_op fp.job.step.input.wiz.l.operator model_fp_job_step_input_wizard_line fusion_plating.group_fusion_plating_operator 1 1 1 1
18 access_fp_job_step_input_wiz_l_sup fp.job.step.input.wiz.l.supervisor model_fp_job_step_input_wizard_line fusion_plating.group_fusion_plating_supervisor 1 1 1 1
19 access_fp_job_step_input_wiz_l_mgr fp.job.step.input.wiz.l.manager model_fp_job_step_input_wizard_line fusion_plating.group_fusion_plating_manager 1 1 1 1
20 access_fp_workflow_state_op fp.workflow.state.operator model_fp_job_workflow_state fusion_plating.group_fusion_plating_operator 1 0 0 0
21 access_fp_workflow_state_sup fp.workflow.state.supervisor model_fp_job_workflow_state fusion_plating.group_fusion_plating_supervisor 1 0 0 0
22 access_fp_workflow_state_mgr fp.workflow.state.manager model_fp_job_workflow_state fusion_plating.group_fusion_plating_manager 1 1 1 1