# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) # # 2026-05-20 Step Kind curation — post-migrate. # # Runs AFTER the schema settles. Marks the 15 retired kinds inactive so # they no longer appear in the dropdown. We keep them in the DB rather # than deleting because: # - ir.model.data rows would dangle and break a future re-import # - audit trail / reports may still reference them by code # - users who undo the curation get one switch back to active=True # # Pre-migrate has already re-mapped every template + node pointing at # these kinds, so flipping active=False has no operator-facing data # impact — it only hides them from pickers. import logging _logger = logging.getLogger(__name__) _RETIRED_CODES = [ 'cleaning', 'electroclean', 'etch', 'rinse', 'strike', 'dry', 'wbf_test', 'demask', 'derack', 'replenishment', 'hardness_test', 'adhesion_test', 'salt_spray', 'packaging', 'gating', ] def migrate(cr, version): cr.execute(""" UPDATE fp_step_kind SET active = false WHERE code = ANY(%s) AND active = true """, (_RETIRED_CODES,)) n = cr.rowcount if n: _logger.info( 'Step Kind curation: retired %d kinds (active=False): %s', n, _RETIRED_CODES, )