odoo.http: 处理请求时发生异常

huangapple go评论71阅读模式
英文:

odoo.http: Exception during request handling

问题

当我尝试在PyCharm中运行Odoo16时,我遇到了以下错误,不知道问题是什么:

2023-05-13 13:21:03,574 31759 ERROR dbodoo16 odoo.http: 请求处理期间出现异常。
Traceback (most recent call last):
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1987, in __call__
    response = request._serve_db()
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1583, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/service/model.py", line 134, in retrying
    result = func()
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1611, in _serve_ir_http
    ir_http._post_dispatch(response)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/addons/base/models/ir_http.py", line 161, in _post_dispatch
    request.dispatcher.post_dispatch(response)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1679, in post_dispatch
    self.request._save_session()
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1511, in _save_session
    self.future_response.set_cookie('session_id', sess.sid, max_age=SESSION_LIFETIME, httponly=True)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1125, in set_cookie
    werkzeug.Response.set_cookie(self, key, value=value, max_age=max_age, expires=expires, path=path, domain=domain, secure=secure, httponly=httponly, samesite=samesite)
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/sansio/response.py", line 258, in set_cookie
    charset = self._charset if self._charset != "utf-8" else None
AttributeError: 'FutureResponse'对象没有属性'_charset'
2023-05-13 13:21:03,575 31759 INFO dbodoo16 werkzeug: 127.0.0.1 - - [13/May/2023 13:21:03] "GET /web/database/manager HTTP/1.1" 500 - 8 0.002 0.245
英文:

When I'm trying to run Odoo16 in my PyCharm I get the following error and don't know what's the problem:

2023-05-13 13:21:03,574 31759 ERROR dbodoo16 odoo.http: Exception during request handling. 
Traceback (most recent call last):
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1987, in __call__
    response = request._serve_db()
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1583, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/service/model.py", line 134, in retrying
    result = func()
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1611, in _serve_ir_http
    ir_http._post_dispatch(response)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/addons/base/models/ir_http.py", line 161, in _post_dispatch
    request.dispatcher.post_dispatch(response)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1679, in post_dispatch
    self.request._save_session()
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1511, in _save_session
    self.future_response.set_cookie('session_id', sess.sid, max_age=SESSION_LIFETIME, httponly=True)
  File "/home/avril/PycharmProjects/odoo-16/odoo/odoo/http.py", line 1125, in set_cookie
    werkzeug.Response.set_cookie(self, key, value=value, max_age=max_age, expires=expires, path=path, domain=domain, secure=secure, httponly=httponly, samesite=samesite)
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/sansio/response.py", line 258, in set_cookie
    charset = self._charset if self._charset != "utf-8" else None
AttributeError: 'FutureResponse' object has no attribute '_charset'
2023-05-13 13:21:03,575 31759 INFO dbodoo16 werkzeug: 127.0.0.1 - - [13/May/2023 13:21:03] "GET /web/database/manager HTTP/1.1" 500 - 8 0.002 0.245

答案1

得分: 1

你正在使用较新版本的werkzeug,所以解决方案是卸载当前版本并安装Odoo 16和Python 3.8建议的版本(0.16.1)。

卸载 werkzeug

sudo pip3 uninstall werkzeug

安装 werkzeug == 0.16.1

sudo pip3 install werkzeug Werkzeug==0.16.1
英文:

You are using a newer version of werkzeug so the solution is to uninstall the current version and install the recommended version for Odoo 16 and python 3.8 (0.16.1)

Uninstall werkzeug

sudo pip3 uninstall werkzeug

Install werkzeug == 0.16.1

sudo pip3 install werkzeug Werkzeug==0.16.1

huangapple
  • 本文由 发表于 2023年5月13日 21:35:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76243002.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定