fix(plating): Sub 3 \u2014 move part_catalog_id/cloned_from_id/treatment_uom to configurator inherit (core can't reference fp.part.catalog)

This commit is contained in:
gsinghpal
2026-04-22 08:52:10 -04:00
parent b1a8849e70
commit 7d5c826f3e
2 changed files with 37 additions and 32 deletions

View File

@@ -201,36 +201,11 @@ class FpProcessNode(models.Model):
# ---- Part ownership & provenance (Sub 3) --------------------------------
# Sub 3 — part ownership. NULL on shared templates (admin-managed);
# populated on every node in a part's cloned tree.
part_catalog_id = fields.Many2one(
'fp.part.catalog',
string='Part',
ondelete='cascade',
index=True,
help='Populated on nodes that belong to a specific part\'s '
'composed process tree. NULL on shared templates.',
)
# Sub 3 — source-template reference on cloned nodes. Enables
# future "template drifted" indicators. Optional, not load-bearing.
cloned_from_id = fields.Many2one(
'fusion.plating.process.node',
string='Cloned From',
ondelete='set null',
help='On a part-cloned node, points back at the source template '
'node it was copied from.',
)
# Sub 3 — per-node treatment UoM for pricing / cost tracking.
treatment_uom = fields.Selection(
[
('lbs', 'Lbs (weight-based)'),
('sq_in', 'Sq in (area-based)'),
],
string='Treatment UoM',
help='How this process step is measured for costing / pricing. '
'Picks which physical property of the part to multiply by '
'the per-unit rate: weight (Lbs) or surface area (Sq in).',
)
# Sub 3 fields (part_catalog_id, cloned_from_id, treatment_uom) are
# declared as an inherit in fusion_plating_configurator — they need
# to reference fp.part.catalog, which lives in configurator (a child
# module). Adding them here would create a circular dependency.
# See fusion_plating_configurator/models/fp_process_node_inherit.py.
# ---- Recipe-only fields (apply when node_type='recipe') -----------------
# These migrate Steelhead's recipe-level metadata: lead time, the