diff --git a/fusion_plating/fusion_plating/__manifest__.py b/fusion_plating/fusion_plating/__manifest__.py index 15453277..53d70c09 100644 --- a/fusion_plating/fusion_plating/__manifest__.py +++ b/fusion_plating/fusion_plating/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Plating', - 'version': '19.0.6.0.0', + 'version': '19.0.6.1.0', 'category': 'Manufacturing/Plating', 'summary': 'Core plating / metal finishing ERP: facilities, processes, tanks, baths, jobs, operators.', 'description': """ diff --git a/fusion_plating/fusion_plating/static/src/js/recipe_tree_editor.js b/fusion_plating/fusion_plating/static/src/js/recipe_tree_editor.js index 9574bd10..e237a3f4 100644 --- a/fusion_plating/fusion_plating/static/src/js/recipe_tree_editor.js +++ b/fusion_plating/fusion_plating/static/src/js/recipe_tree_editor.js @@ -112,13 +112,23 @@ export class RecipeTreeEditor extends Component { addingTo: null, // parent node id when "add" dialog is open newNodeName: "", newNodeType: "operation", + // True when this editor instance was opened from the part- + // scoped Process Composer; drives the back-button label. + fromPart: false, }); this._recipeId = null; + // When the tree editor is opened from the part-scoped Process + // Composer, the composer passes `part_id` in the action context. + // Capture it so the back button returns to the part form instead + // of the generic Recipes list. + this._partId = null; onMounted(async () => { const ctx = this.props.action?.context || {}; this._recipeId = ctx.recipe_id || null; + this._partId = ctx.part_id || null; + this.state.fromPart = !!this._partId; if (this._recipeId) { await this.loadTree(); } @@ -415,6 +425,19 @@ export class RecipeTreeEditor extends Component { // ---- Navigation --------------------------------------------------------- onBackToList() { + // If the editor was opened from the part-scoped Process Composer + // (context carried part_id), return to that part's form instead + // of the generic Recipes list. + if (this._partId) { + this.action.doAction({ + type: "ir.actions.act_window", + res_model: "fp.part.catalog", + res_id: this._partId, + views: [[false, "form"]], + target: "current", + }); + return; + } this.action.doAction("fusion_plating.action_fp_process_recipe"); } diff --git a/fusion_plating/fusion_plating/static/src/xml/recipe_tree_editor.xml b/fusion_plating/fusion_plating/static/src/xml/recipe_tree_editor.xml index c6234964..83067eb6 100644 --- a/fusion_plating/fusion_plating/static/src/xml/recipe_tree_editor.xml +++ b/fusion_plating/fusion_plating/static/src/xml/recipe_tree_editor.xml @@ -150,8 +150,10 @@