From 3fdbeed813550c69598ba3d7d823d75faea313da Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Fri, 22 May 2026 21:53:19 -0400 Subject: [PATCH] feat(fusion_plating_jobs): Open Workspace smart button on fp.job form Plan task P1.16. Header button on the fp.job form that opens the JobWorkspace OWL client action focused on the current WO. Primary entry point for techs before the Landing kanban (Phase 3) ships; remains as a back-office shortcut after. Hidden when state == 'draft' (no steps to work yet). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../fusion_plating_jobs/models/fp_job.py | 16 ++++++++++++++++ .../views/fp_job_form_inherit.xml | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/fusion_plating/fusion_plating_jobs/models/fp_job.py b/fusion_plating/fusion_plating_jobs/models/fp_job.py index 9810a39b..311a0a64 100644 --- a/fusion_plating/fusion_plating_jobs/models/fp_job.py +++ b/fusion_plating/fusion_plating_jobs/models/fp_job.py @@ -576,6 +576,22 @@ class FpJob(models.Model): 'context': {'default_job_id': self.id}, } + def action_open_workspace(self): + """Open the JobWorkspace OWL client action focused on this job. + + Spec: 2026-05-22-shopfloor-tablet-redesign — Phase 1 deliverable. + Used as the smart-button entry point before the Landing kanban + (Phase 3) is shipped, and stays as a back-office shortcut after. + """ + self.ensure_one() + return { + 'type': 'ir.actions.client', + 'tag': 'fp_job_workspace', + 'name': self.display_wo_name or self.name, + 'params': {'job_id': self.id}, + 'target': 'current', + } + def action_finish_current_step(self): """Steelhead-style header button: finish whatever's currently in_progress and auto-start the next pending/ready step. If diff --git a/fusion_plating/fusion_plating_jobs/views/fp_job_form_inherit.xml b/fusion_plating/fusion_plating_jobs/views/fp_job_form_inherit.xml index 8b76e959..63946950 100644 --- a/fusion_plating/fusion_plating_jobs/views/fp_job_form_inherit.xml +++ b/fusion_plating/fusion_plating_jobs/views/fp_job_form_inherit.xml @@ -20,6 +20,15 @@ + +