feat(plating): Phase 1 — plant-view kanban data model foundation

PV-T1: fp.work.centre.area_kind Selection (9 floor columns)
PV-T2: fp.job.step.area_kind compute + _STEP_KIND_TO_AREA fallback
       (covers all 30+ step kinds in the project library, plus the
       spec D4 rule that de_mask folds into de_racking)
PV-T3: fp.job.step.last_activity_at + write hook + message_post
       override + fp.job.step.move.create() hook + _fp_is_idle helper
PV-T4: res.users.paired_work_centre_ids M2M (single-station for MVP,
       forward-compatible for Phase 2 multi-station picker)
PV-T5: res.config.settings.x_fc_shopfloor_layout feature flag backed
       by ir.config_parameter for the landing-action resolver

Migrations:
  fusion_plating 19.0.21.0.0      — backfill area_kind from kind
  fusion_plating_jobs 19.0.10.24.0 — backfill last_activity_at

Deployed + verified on entech:
  - 9/9 fp.work.centre rows have area_kind set
  - 400/400 fp.job.step rows have area_kind + last_activity_at
  - paired_work_centre_ids M2M relation table created
  - All 271 modules loaded cleanly, registry rebuilt in 27s

Part of the 2026-05-23 Shop Floor plant-view kanban redesign.
Plan: docs/superpowers/plans/2026-05-23-shopfloor-plant-view-plan.md
Spec: docs/superpowers/specs/2026-05-23-shopfloor-plant-view-design.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-23 20:43:15 -04:00
parent 1a3ca8704e
commit 63d692b322
11 changed files with 302 additions and 3 deletions

View File

@@ -9,3 +9,4 @@ from . import fp_first_piece_gate
from . import fp_operator_queue
from . import fp_tank
from . import res_users
from . import res_config_settings

View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
"""Feature flags for fusion_plating_shopfloor.
Currently:
- x_fc_shopfloor_layout — switches the Shop Floor client action
between the legacy per-step kanban and the v2 plant-view kanban.
Backed by ir.config_parameter so the landing-action resolver can
read it cheaply on every action open without a recordset fetch.
"""
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
x_fc_shopfloor_layout = fields.Selection(
[
('legacy', 'Legacy (per-step kanban)'),
('v2', 'Plant View (one card per job, 9 columns)'),
],
string='Shop Floor Layout',
default='legacy',
config_parameter='fusion_plating_shopfloor.layout',
help='Switches the Shop Floor client action between the legacy '
'per-step kanban and the v2 plant view. Defaults to legacy '
'during the parallel rollout; flip to v2 once validated. '
'The landing-action resolver reads this from '
'ir.config_parameter (key: fusion_plating_shopfloor.layout).',
)

View File

@@ -45,6 +45,19 @@ class ResUsers(models.Model):
'Null when not locked. Set after the configured fail '
'threshold (default 5) is reached.',
)
paired_work_centre_ids = fields.Many2many(
'fp.work.centre',
'res_users_fp_work_centre_paired_rel',
'user_id',
'work_centre_id',
string='Paired Work Centres',
help='Stations the operator is currently paired to via the tablet. '
'MVP holds exactly one row on day 1 (the dropdown-selected '
'station). The Phase 2 multi-station picker can populate '
'multiple. Drives the "is this card mine" check on the '
'plant-view kanban (cards whose active_step.work_centre is '
'in this M2M get the yellow ⭐ treatment).',
)
@staticmethod
def _hash_tablet_pin(pin, salt=None):