fix(configurator): copy operator-input prompts when cloning recipe to part

_clone_subtree() in fp_part_composer_controller built node vals
manually and never copied source.input_ids — so 'Load Template'
copied the recipe tree structure but dropped every custom prompt,
leaving operators with empty data-capture screens. The fix iterates
input_ids and calls .copy({'node_id': new_node.id}) so kind,
target_min/max/unit, compliance_tag, hint, selection_options,
sequence — every field on the input model — flows through.

Verified on entech: ENP-ALUM-BASIC clone now shows all 105 prompts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-12 17:58:11 -04:00
parent b5416d242c
commit 5b399fbdda
2 changed files with 10 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
{
'name': 'Fusion Plating — Configurator',
'version': '19.0.18.10.3',
'version': '19.0.18.10.4',
'category': 'Manufacturing/Plating',
'summary': 'Quotation configurator with part catalog, coating configs, and formula-based pricing engine.',
'description': """

View File

@@ -124,6 +124,15 @@ def _clone_subtree(env, source, part, parent):
new_node = Node.create(vals)
# Copy operator-input prompts (temperature reading, visual inspection,
# etc.) onto the cloned node. Without this, "Load Template" copies the
# step structure but loses every custom prompt the recipe author set up
# — operators end up with empty data-capture screens. .copy() handles
# every field on the input model (kind, target_min/max/unit,
# compliance_tag, sequence, hint, …) and rebinds node_id via override.
for src_input in source.input_ids:
src_input.copy({'node_id': new_node.id})
# Recurse into children in deterministic sequence order.
for child in source.child_ids.sorted('sequence'):
_clone_subtree(env, child, part, new_node)