我正在尝试从我的Node.js项目中调用odoo。但问题是会话超时错误。
我遵循以下步骤,请告诉我哪里出了问题?
1. localhost:8069/web/session/authenticate
头部输出:Set-Cookie: session_id=558883b8c51a85d9dd1bb1f2ff10bc9b1cdc3ddd; Expires=Wed, 25-Jan-2023 11:35:54 GMT;
2. Sending the session_id in header for next requests as
headers: { 'Content-Type': 'application/json', 'Connection':'keep-alive', 'Cache-Control': 'no-cache' }
但它给了我以下错误:
{"jsonrpc":"2.0","id":null,"error":{
"code":100,"message":"Odoo Session Expired",
"data":{"name":"odoo.http.SessionExpiredException",
"debug":"Traceback (most recent call last):\n File
\"/opt/odoo/addons/http_routing/models/ir_http.py\", line 450, in _dispatch\n cls._authenticate(func)\n File \"/opt/odoo/odoo/addons/base/models/ir_http.py\", line 127, in _authenticate\n getattr(cls, \"_auth_method_%s\" % auth_method)()\n File \"/opt/odoo/odoo/addons/base/models/ir_http.py\", line 97, in _auth_method_user\n raise http.SessionExpiredException(\"Session expired\")\nException\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/opt/odoo/odoo/http.py\", line 639, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File \"/opt/odoo/odoo/http.py\", line 315, in _handle_exception\n raise exception.with_traceback(None) from new_cause\nodoo.http.SessionExpiredException: Session expired\n",
"message":"Session expired","arguments":["Session expired"],"context":{}}}}
但是,如果我从POSTMAN向localhost发送请求:8069/web/会话/身份验证,然后直接调用另一个odoo,那么它将给出预期的结果。
我不明白邮递员请求发送什么params,所以会话对所有其他请求都有效。
我试图在django实现,但同样的问题在那里。否则,在每个请求中,您必须传递dbname、密码、用户名。
发布于 2022-10-27 14:53:43
试图在现有数据库中安装模块,并且应该能够很好地工作。
https://stackoverflow.com/questions/74223861
复制相似问题