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:
@@ -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.',
|
||||
|
||||
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user