From 84bfa39911ca178756aeac1c3e1c83f0d40bf1a6 Mon Sep 17 00:00:00 2001 From: dtgagnon Date: Sat, 6 Dec 2025 22:05:40 -0500 Subject: [PATCH] [FIX] base_remote: Allow RPC authentication without HTTP context When authenticating via XML-RPC or JSON-RPC, there is no HTTP request context available. The remote property gracefully handles this by returning an empty recordset, but the ensure_one() check was still enforced, causing authentication to fail. This change skips the singleton check when remote is empty (no HTTP context), while maintaining device tracking for web browser connections. Fixes #3458 --- base_remote/models/res_users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_remote/models/res_users.py b/base_remote/models/res_users.py index 7091e959351..9454eea3233 100644 --- a/base_remote/models/res_users.py +++ b/base_remote/models/res_users.py @@ -16,7 +16,7 @@ def _auth_check_remote(cls, credential, method): with cls.pool.cursor() as cr: env = api.Environment(cr, SUPERUSER_ID, {}) remote = env["res.users"].remote - if not config["test_enable"]: + if not config["test_enable"] and remote: remote.ensure_one() result = method() if not result: