From 6afc9e3c0d052ea823a702e96682a7556ac98e77 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 24 May 2026 17:13:42 -0400 Subject: [PATCH] fix(fusion_plating): tracking warning + De-Masking pattern anchor - fp.step.kind.area_kind: drop tracking=True (model doesn't inherit mail.thread; tracking was a no-op emitting a startup warning). - Migration 19.0.10.25.0: anchor the De-Masking ILIKE so it doesn't wildcard-match "Ready For De-Masking" (which the earlier "Ready %" rule already routes to gating). Also drop the cur_code='mask' filter so the 4 De-Masking nodes still classified as 'other' get picked up on fresh re-runs too. Direct SQL applied the 4-row fix on entech (post-migrate doesn't re-run for already-applied versions); this commit keeps fresh installs and any future re-runs consistent. Co-Authored-By: Claude Opus 4.7 (1M context) --- fusion_plating/fusion_plating/models/fp_step_kind.py | 1 - .../migrations/19.0.10.25.0/post-migrate.py | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fusion_plating/fusion_plating/models/fp_step_kind.py b/fusion_plating/fusion_plating/models/fp_step_kind.py index af897cad..49aaaed7 100644 --- a/fusion_plating/fusion_plating/models/fp_step_kind.py +++ b/fusion_plating/fusion_plating/models/fp_step_kind.py @@ -54,7 +54,6 @@ class FpStepKind(models.Model): string='Shop Floor Column', required=True, index=True, - tracking=True, help='Determines which column on the Shop Floor plant kanban shows ' 'cards whose active step uses this kind. Step kinds drive ' 'routing automatically — picking a kind tells the system both ' diff --git a/fusion_plating/fusion_plating_jobs/migrations/19.0.10.25.0/post-migrate.py b/fusion_plating/fusion_plating_jobs/migrations/19.0.10.25.0/post-migrate.py index 3f547eac..3fa9bf5d 100644 --- a/fusion_plating/fusion_plating_jobs/migrations/19.0.10.25.0/post-migrate.py +++ b/fusion_plating/fusion_plating_jobs/migrations/19.0.10.25.0/post-migrate.py @@ -66,7 +66,13 @@ TEMPLATE_BACKFILL = { NODE_REPOINTING = [ ("n.name = 'Blasting'", 'other', 'blast', 'Blasting -> blast'), ("n.name ILIKE 'Ready %%'", None, 'gating', 'Ready For X -> gating'), - ("n.name ILIKE '%%De-Masking%%' OR n.name ILIKE '%%DeMasking%%'", 'mask', 'demask', 'De-Masking -> demask'), + # De-Masking: anchored ILIKE (must start with "De-Masking" or + # "DeMasking") so we don't match "Ready For De-Masking" which the + # earlier 'Ready %' rule already moved to gating. cur_code=None + # catches both 'mask' (the 34 lazy/legacy ones) and 'other' (4 + # older nodes never reclassified after the demask kind was added). + # The trailing AND k.code != %s safeguard skips already-correct rows. + ("(n.name ILIKE 'De-Masking%%' OR n.name ILIKE 'DeMasking%%')", None, 'demask', 'De-Masking -> demask'), ("n.name = 'Scheduling'", 'other', 'gating', 'Scheduling -> gating'), ("n.name ILIKE '%%Nickel Strip%%'", 'plate', 'wet_process', 'Nickel Strip -> wet_process'), ("n.name ILIKE '%%Pre-Measurement%%' OR n.name ILIKE '%%Check Sulfamate%%'", 'other', 'inspect', 'Pre-Meas/Check Sulfamate -> inspect'),