From 01a46e33e2795bb0ca6b6579aed0f80b77379ec4 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Tue, 12 May 2026 09:05:27 -0400 Subject: [PATCH] fix(process-tree): breadcrumb pile-up + dead "No MO selected" banner Two issues on the Process Tree client action: 1. Back to Work Order kept growing breadcrumbs (WO -> Tree -> WO -> Tree -> ...) because onBack used action.doAction() which PUSHES a new act_window onto the stack instead of popping. Fixed by trying action.restore() first (pops the Tree off the stack and returns to the parent WO/Step controller). Falls through to explicit doAction only when there's no parent in the stack (direct URL access). 2. The empty-state banner referenced productionId, a dead variable from the bridge_mrp era when the tree was tied to mrp.production. Since the component now uses jobId (fp.job context key), the "No manufacturing order selected" message ALWAYS fired regardless of whether a job was loaded. Fixed by using jobId and updating the message to "No work order selected". Co-Authored-By: Claude Opus 4.7 (1M context) --- .../fusion_plating_shopfloor/__manifest__.py | 2 +- .../static/src/js/process_tree.js | 13 +++++++++++++ .../static/src/xml/process_tree.xml | 8 ++++---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/fusion_plating/fusion_plating_shopfloor/__manifest__.py b/fusion_plating/fusion_plating_shopfloor/__manifest__.py index b59f4089..4f9f596a 100644 --- a/fusion_plating/fusion_plating_shopfloor/__manifest__.py +++ b/fusion_plating/fusion_plating_shopfloor/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Plating — Shop Floor', - 'version': '19.0.25.2.0', + 'version': '19.0.25.2.1', 'category': 'Manufacturing/Plating', 'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer, ' 'first-piece inspection gates.', diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/js/process_tree.js b/fusion_plating/fusion_plating_shopfloor/static/src/js/process_tree.js index 75173b8b..f7b3c2d3 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/js/process_tree.js +++ b/fusion_plating/fusion_plating_shopfloor/static/src/js/process_tree.js @@ -131,6 +131,19 @@ export class ProcessTree extends Component { } onBack() { + // Try action.restore() first — that pops the Process Tree + // off the breadcrumb stack and returns the user to the WO + // (or Step) they came from. Without this, doAction pushes a + // NEW act_window each time and the breadcrumb keeps growing + // (WO → Tree → WO → Tree → ...). + try { + this.action.restore(); + return; + } catch (e) { + // No parent in the stack (user opened Process Tree by + // URL or as the first action). Fall through to explicit + // navigation. + } const stepId = this.backStepId; if (stepId) { this.action.doAction({ diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/xml/process_tree.xml b/fusion_plating/fusion_plating_shopfloor/static/src/xml/process_tree.xml index d5420da8..60243e92 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/xml/process_tree.xml +++ b/fusion_plating/fusion_plating_shopfloor/static/src/xml/process_tree.xml @@ -119,14 +119,14 @@
+ t-if="!state.loading and !jobId"> -
No manufacturing order selected.
+
No work order selected.
+ t-if="!state.loading and jobId and !state.root"> -
No process steps for this order.
+
No process steps for this work order.