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'),