From c75d2bde5a9aabbb71a9823a02cd3bf7f1788743 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 24 May 2026 16:56:05 -0400 Subject: [PATCH] fix(shopfloor): session.authenticate signature update for Odoo 19 Odoo 19's Session.authenticate(env, credential) takes an Environment as the first arg, not a db-name string. Passing request.db triggered TypeError: 'str' object is not callable on the internal env(user=None, su=False) reset. Fixes the "Odoo Server Error" dialog operators saw when trying to PIN unlock from the tablet. Same fix applies to lock_session (which was silently masked by its broad except Exception). Bumps fusion_plating_shopfloor to 19.0.33.1.2. Co-Authored-By: Claude Opus 4.7 (1M context) --- fusion_plating/fusion_plating_shopfloor/__manifest__.py | 2 +- .../controllers/tablet_controller.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fusion_plating/fusion_plating_shopfloor/__manifest__.py b/fusion_plating/fusion_plating_shopfloor/__manifest__.py index 77f28760..d6466808 100644 --- a/fusion_plating/fusion_plating_shopfloor/__manifest__.py +++ b/fusion_plating/fusion_plating_shopfloor/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Plating — Shop Floor', - 'version': '19.0.33.1.1', + 'version': '19.0.33.1.2', 'category': 'Manufacturing/Plating', 'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer, ' 'first-piece inspection gates.', diff --git a/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py b/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py index 0085ba4d..760fe3c4 100644 --- a/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py +++ b/fusion_plating/fusion_plating_shopfloor/controllers/tablet_controller.py @@ -198,9 +198,13 @@ class FpTabletController(http.Controller): # Attempt the real Odoo session swap via the custom auth manager. # session.authenticate validates credentials through _check_credentials, # issues a new sid, sets the cookie, returns the user dict. + # NB: Odoo 19's Session.authenticate signature is (env, credential) — + # passing request.db (a string) raises TypeError: 'str' object is not + # callable on the internal env(user=None, su=False) reset. Pass + # request.env instead. try: request.session.authenticate( - request.db, + request.env, {'type': 'fp_tablet_pin', 'login': target.login, 'pin': pin}, @@ -355,8 +359,9 @@ class FpTabletController(http.Controller): 'needs_kiosk_relogin': True} try: + # Odoo 19 signature: (env, credential) — see unlock_session note. request.session.authenticate( - request.db, + request.env, {'type': 'password', 'login': kiosk_login, 'password': kiosk_password},