From 2f8db6d59273a5410471430dbe126eaaa08d8378 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 3 May 2026 22:39:39 -0400 Subject: [PATCH] fix(jobs): header Finish & Next propagates button_start's action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: action_finish_current_step (the header-level Finish & Next button on the job form) called button_start() without capturing its return value. So when button_start returned an action (e.g. the new QA-005 redirect for contract_review steps from 21e42e7), the header method threw it away and returned True. Result: operator clicked Finish & Next, the step started, but no navigation. They had to click again — the second click found the in_progress step, called action_finish_and_advance, which returned the QA-005 action. Two clicks instead of one to land on QA-005. Fix: capture button_start's return value. If it's a dict (= an action), return it. Otherwise return True (the normal case). User reproduction (WH/JOB/00341): Header > Finish & Next (1st click) → step starts + QA-005 opens Sign / dismiss QA-005 → back to job Header > Finish & Next (2nd click) → step finishes + next starts Co-Authored-By: Claude Opus 4.7 (1M context) --- fusion_plating/fusion_plating_jobs/__manifest__.py | 2 +- .../fusion_plating_jobs/models/fp_job.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/fusion_plating/fusion_plating_jobs/__manifest__.py b/fusion_plating/fusion_plating_jobs/__manifest__.py index f6e6bba1..e24214a1 100644 --- a/fusion_plating/fusion_plating_jobs/__manifest__.py +++ b/fusion_plating/fusion_plating_jobs/__manifest__.py @@ -3,7 +3,7 @@ # License OPL-1 (Odoo Proprietary License v1.0) { 'name': 'Fusion Plating — Native Jobs', - 'version': '19.0.8.17.1', + 'version': '19.0.8.17.2', 'category': 'Manufacturing/Plating', 'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.', 'author': 'Nexa Systems Inc.', diff --git a/fusion_plating/fusion_plating_jobs/models/fp_job.py b/fusion_plating/fusion_plating_jobs/models/fp_job.py index b78c4d3a..3e72606a 100644 --- a/fusion_plating/fusion_plating_jobs/models/fp_job.py +++ b/fusion_plating/fusion_plating_jobs/models/fp_job.py @@ -263,6 +263,11 @@ class FpJob(models.Model): nothing is running yet, start the lowest-sequence pending step instead — operator's first click on a fresh job just begins the line. + + Sub 12e v4 — when button_start returns an action (e.g. the + QA-005 redirect for contract_review steps), propagate it so + the operator lands on the right page in ONE click instead of + two. """ self.ensure_one() running = self.step_ids.filtered(lambda s: s.state == 'in_progress')[:1] @@ -277,10 +282,17 @@ class FpJob(models.Model): 'No runnable step found on this job — either every step ' 'is done or the job is still in draft.' )) - first.with_context(fp_skip_predecessor_check=True).button_start() + result = first.with_context( + fp_skip_predecessor_check=True, + ).button_start() self.message_post(body=_( 'Started first step "%s".' ) % first.name) + # Propagate any action returned by button_start (e.g. the + # QA-005 redirect on a contract_review step). If it's just + # True/False (the normal case), fall back to True. + if isinstance(result, dict): + return result return True def action_open_move_wizard(self):