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):