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, } # ======================================================================