This commit is contained in:
gsinghpal
2026-05-25 20:11:03 -04:00
parent 67af54b46e
commit 5f372b462a
21 changed files with 444 additions and 833 deletions

View File

@@ -148,22 +148,17 @@ class IrActionsActWindow(models.Model):
@api.model
def _fp_workstation_action_for_layout(self, company):
"""Single source of truth: which Shop Floor surface is active on
this DB?
"""Resolve the Shop Floor surface for technicians + shop managers.
``ir.config_parameter['fusion_plating_shopfloor.layout']`` is the
feature flag. Flipping it instantly retargets every Technician /
Shop Manager landing on next page load.
Returns ``action_fp_plant_kanban`` (the 2026-05-23 plant view).
The legacy ``fp_shopfloor_landing`` component was retired
2026-05-25 (one feature ported across — the inline QR scanner).
The ``fusion_plating_shopfloor.layout`` ir.config_parameter
survives orphaned for one release cycle so we can ship a
settings-UI cleanup separately; flipping it has no effect.
"""
param = self.env['ir.config_parameter'].sudo().get_param(
'fusion_plating_shopfloor.layout', 'v2')
if param == 'v2':
return self.env.ref(
'fusion_plating_shopfloor.action_fp_plant_kanban',
raise_if_not_found=False,
)
return self.env.ref(
'fusion_plating_shopfloor.action_fp_shopfloor_landing',
'fusion_plating_shopfloor.action_fp_plant_kanban',
raise_if_not_found=False,
)

View File

@@ -119,21 +119,19 @@ class TestLandingResolver(TransactionCase):
self.skipTest('Plant Kanban action not found')
self.assertEqual(self._resolve_xmlid(self.u_tech), expected)
def test_technician_lands_on_legacy_workstation(self):
def test_technician_lands_on_plant_kanban_regardless_of_legacy_flag(self):
"""The legacy 'fp_shopfloor_landing' component was retired
2026-05-25. The ``fusion_plating_shopfloor.layout`` flag is now
orphaned (kept in res.config.settings for one release cycle) and
flipping it must NOT change the landing — every technician lands
on the plant kanban."""
self.env['ir.config_parameter'].sudo().set_param(
'fusion_plating_shopfloor.layout', 'legacy')
expected = self._xmlid_of('fusion_plating_shopfloor.action_fp_shopfloor_landing')
expected = self._xmlid_of('fusion_plating_shopfloor.action_fp_plant_kanban')
if not expected:
# The legacy action is currently not defined by that xmlid
# in this codebase — both old XMLIDs (action_fp_shopfloor_tablet
# and action_fp_plant_overview) point at the v2 fp_plant_kanban
# tag after the 2026-05-23 plant-view redesign. The resolver
# falls through to the company default / hardcoded fallback
# when no action is found. Skip the assertion here rather
# than fail.
self.skipTest('Legacy Workstation action not found in this DB')
self.skipTest('Plant Kanban action not found')
self.assertEqual(self._resolve_xmlid(self.u_tech), expected)
# Reset to v2 to avoid bleeding into other tests
# Reset for downstream tests
self.env['ir.config_parameter'].sudo().set_param(
'fusion_plating_shopfloor.layout', 'v2')