feat(sub12b): fp.rack.tag — rack-label registry + 4 starter tags
M2M tag registry: Rush / Hold for QC / Damaged / Customer Sample. Each rack can carry many tags; tags surface as coloured chips on the plant-overview rack rows + Move Rack dialog (Task 13). Plating → Configuration → Rack Tags menu (sequence 48). post_init_hook seeds 4 starters — idempotent (no-op if any exist). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,10 +22,12 @@ def post_init_hook(env):
|
||||
`kind` field.
|
||||
3. Sub 12a — seed fp.step.template with starter library entries
|
||||
derived from ENP-ALUM-BASIC if the library is currently empty.
|
||||
4. Sub 12b — seed 4 starter rack tags if the registry is empty.
|
||||
"""
|
||||
_seed_default_timezone(env)
|
||||
_backfill_node_input_kind(env)
|
||||
_seed_step_library_if_empty(env)
|
||||
_seed_rack_tags_if_empty(env)
|
||||
|
||||
|
||||
def _seed_default_timezone(env):
|
||||
@@ -185,3 +187,21 @@ def _seed_minimal_library(env):
|
||||
'Fusion Plating: seeded minimal step library (%s entries)',
|
||||
len(minimal),
|
||||
)
|
||||
|
||||
|
||||
def _seed_rack_tags_if_empty(env):
|
||||
"""Sub 12b — seed 4 starter rack tags."""
|
||||
Tag = env['fp.rack.tag']
|
||||
if Tag.search_count([]):
|
||||
return
|
||||
starters = [
|
||||
('Rush', 1),
|
||||
('Hold for QC', 3),
|
||||
('Damaged', 9),
|
||||
('Customer Sample', 5),
|
||||
]
|
||||
for name, color in starters:
|
||||
Tag.create({'name': name, 'color': color})
|
||||
_logger.info(
|
||||
'Fusion Plating: seeded %s starter rack tags', len(starters),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user