I am using odoo V16. When I send a POST request to web/session/authenticate endpoint with the correct user credentials in the body like this:
{
"params": {
"db":<DB>,
"login": <LOGIN>,
"password": <PASSWORD>
}
}
I get a bad response with the error message "'NoneType' object has no attribute 'user'". The expected behavior is a JSON response with session info like:
{
"jsonrpc": "2.0",
"id": null,
"result": {...}
}
I'm not sure if it is a bug in the new odoo version or I'm doing something wrong. Any help is appreciated. Thanks!
Full error response:
{ "jsonrpc": "2.0", "id": null, "error": { "code": 200, "message": "Odoo Server Error", "data": { "name": "builtins.AttributeError", "debug": "Traceback (most recent call last): File "/odoo-16/odoo/http.py", line 1963, in call response = request._serve_nodb() File "/odoo-16/odoo/http.py", line 1516, in _serve_nodb response = self.dispatcher.dispatch(rule.endpoint, args) File "/odoo-16/odoo/http.py", line 1775, in dispatch result = endpoint(**self.request.params) File "/odoo-16/odoo/http.py", line 673, in route_wrapper result = endpoint(self, *args, **params_ok) File "/odoo-16/addons/web/controllers/session.py", line 52, in authenticate print('session_info', env['ir.http'].session_info()) File "/odoo-16/addons/web_tour/models/ir_http.py", line 12, in session_info result = super().session_info() File "/odoo-16/addons/web/models/ir_http.py", line 68, in session_info user = request.env.user AttributeError: 'NoneType' object has no attribute 'user' ", "message": "'NoneType' object has no attribute 'user'", "arguments": [ "'NoneType' object has no attribute 'user'" ], "context": {} } } }