From 10477a7c8f68c5ced05ca7bc897a39ad02dc95e8 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 24 May 2026 13:14:41 -0400 Subject: [PATCH] feat(shopfloor): /fp/tablet/tiles returns session_mode + kiosk_uid OWL lock screen needs to know (a) the active session mode (legacy or session_swap) to branch between endpoints, and (b) the kiosk uid to determine 'is the current browser session the kiosk?' Both come from the bootstrap response so no extra round-trips on every render. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../controllers/tablet_controller.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py b/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py index be0748b3..ef67343e 100644 --- a/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py +++ b/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py @@ -498,10 +498,24 @@ class FpTabletController(http.Controller): }) # Clocked-in first, then alphabetical within bucket tiles.sort(key=lambda t: (not t['is_clocked_in'], t['name'])) + # Phase D bootstrap: lock screen needs the feature flag + kiosk + # uid so it knows whether to call /unlock (legacy) or + # /unlock_session (new), and whether the current session is + # the kiosk's (= no tech logged in). + ICP = env['ir.config_parameter'].sudo() + session_mode = ICP.get_param('fp.shopfloor.tablet_session_mode', 'legacy') + kiosk = env.ref( + 'fusion_plating_shopfloor.user_fp_tablet_kiosk', + raise_if_not_found=False, + ) + kiosk_uid = kiosk.id if kiosk else None return { 'ok': True, 'company': _lock_company_payload(request.env), 'tiles': tiles, + 'tablet_session_mode': session_mode, + 'kiosk_uid': kiosk_uid, + 'current_uid': request.env.uid, } # ======================================================================