feat(jobs): Phase 6 — Process Tree OWL component for fp.job
Ports fusion_plating_shopfloor's process_tree.js to bind to fp.job instead of mrp.production. Consumes the /fp/jobs/process_tree JSON endpoint built in Phase 6 lean. Renders the recipe tree as cards. Each operation card shows the step state (pending/ready/in_progress/done/etc.) when there's a matching fp.job.step. Click an operation card -> open the step form. Click Back -> return to the job form. New 'Process Tree' button on the fp.job form (manager-only) launches the client action with job_id context. Manifest 19.0.2.1.0 -> 19.0.2.2.0. Part of: native job model migration (spec 2026-04-25) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -253,6 +253,26 @@ class FpJob(models.Model):
|
||||
)
|
||||
return True
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# UI — Process Tree client action (Phase 6)
|
||||
# ------------------------------------------------------------------
|
||||
def action_open_process_tree(self):
|
||||
"""Open the OWL process-tree visualization for this job.
|
||||
|
||||
Launches the fp_job_process_tree client action with job_id in
|
||||
context. The component fetches /fp/jobs/process_tree and renders
|
||||
the recipe -> sub_process -> operation hierarchy as cards with
|
||||
per-step state badges.
|
||||
"""
|
||||
self.ensure_one()
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'fp_job_process_tree',
|
||||
'context': {'job_id': self.id},
|
||||
'name': 'Process Tree — %s' % (self.name or ''),
|
||||
'target': 'current',
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Lifecycle hooks (Tasks 2.6, 2.7, 2.8)
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user