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) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-24 16:56:05 -04:00
parent 9e6b88f60e
commit c75d2bde5a
2 changed files with 8 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
{ {
'name': 'Fusion Plating — Shop Floor', 'name': 'Fusion Plating — Shop Floor',
'version': '19.0.33.1.1', 'version': '19.0.33.1.2',
'category': 'Manufacturing/Plating', 'category': 'Manufacturing/Plating',
'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer, ' 'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer, '
'first-piece inspection gates.', 'first-piece inspection gates.',

View File

@@ -198,9 +198,13 @@ class FpTabletController(http.Controller):
# Attempt the real Odoo session swap via the custom auth manager. # Attempt the real Odoo session swap via the custom auth manager.
# session.authenticate validates credentials through _check_credentials, # session.authenticate validates credentials through _check_credentials,
# issues a new sid, sets the cookie, returns the user dict. # 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: try:
request.session.authenticate( request.session.authenticate(
request.db, request.env,
{'type': 'fp_tablet_pin', {'type': 'fp_tablet_pin',
'login': target.login, 'login': target.login,
'pin': pin}, 'pin': pin},
@@ -355,8 +359,9 @@ class FpTabletController(http.Controller):
'needs_kiosk_relogin': True} 'needs_kiosk_relogin': True}
try: try:
# Odoo 19 signature: (env, credential) — see unlock_session note.
request.session.authenticate( request.session.authenticate(
request.db, request.env,
{'type': 'password', {'type': 'password',
'login': kiosk_login, 'login': kiosk_login,
'password': kiosk_password}, 'password': kiosk_password},