python - 当我尝试运行 Odoo 时,为什么会出现错误 "Name node can' t be use with 'None' Constant”?

标签 python odoo python-3.8

我正在尝试按照 github 页面上链接的说明在我的 mac 上设置 odoo。使用此命令启动服务器时:

python3 odoo-bin --addons-path=addons -d mydb -i base

服务器启动,我在 odoo 初始页面上看到一个数据库“mydb”。然后,当我单击该数据库时,出现以下错误:

ERROR mydb werkzeug: Error on request:
    Traceback (most recent call last):
      File "/Users/[username]/Documents/GitHub/odoo/venv/lib/python3.8/site-packages/werkzeug/serving.py", line 270, in run_wsgi
        execute(self.server.app)
      File "/Users/[username]/Documents/GitHub/odoo/venv/lib/python3.8/site-packages/werkzeug/serving.py", line 258, in execute
        application_iter = app(environ, start_response)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/service/server.py", line 439, in app
        return self.app(e, s)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/service/wsgi_server.py", line 142, in application
        return application_unproxied(environ, start_response)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/service/wsgi_server.py", line 117, in application_unproxied
        result = odoo.http.root(environ, start_response)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 1287, in __call__
        return self.dispatch(environ, start_response)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 1257, in __call__
        return self.app(environ, start_wrapped)
      File "/Users/[username]/Documents/GitHub/odoo/venv/lib/python3.8/site-packages/werkzeug/wsgi.py", line 766, in __call__
        return self.app(environ, start_response)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 1457, in dispatch
        result = ir_http._dispatch()
      File "/Users/[username]/Documents/GitHub/odoo/addons/web_editor/models/ir_http.py", line 21, in _dispatch
        return super(IrHttp, cls)._dispatch()
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/ir_http.py", line 238, in _dispatch
        return cls._handle_exception(e)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/ir_http.py", line 206, in _handle_exception
        return request._handle_exception(exception)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 750, in _handle_exception
        return super(HttpRequest, self)._handle_exception(exception)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 310, in _handle_exception
        raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
      File "/Users/[username]/Documents/GitHub/odoo/odoo/tools/pycompat.py", line 14, in reraise
        raise value
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/ir_http.py", line 234, in _dispatch
        result = request.dispatch()
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 809, in dispatch
        r = self._call_function(**self.params)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 350, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/service/model.py", line 94, in wrapper
        return f(dbname, *args, **kwargs)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 342, in checked_call
        result.flatten()
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 1236, in flatten
        self.response.append(self.render())
      File "/Users/[username]/Documents/GitHub/odoo/odoo/http.py", line 1229, in render
        return env["ir.ui.view"].render_template(self.template, self.qcontext)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/ir_ui_view.py", line 1177, in render_template
        return self.browse(self.get_view_id(template)).render(values, engine)
      File "/Users/[username]/Documents/GitHub/odoo/addons/web_editor/models/ir_ui_view.py", line 27, in render
        return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/ir_ui_view.py", line 1185, in render
        return self.env[engine].render(self.id, qcontext)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/ir_qweb.py", line 58, in render
        result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/qweb.py", line 260, in render
        self.compile(template, options)(self, body.append, values or {})
      File "<decorator-gen-53>", line 2, in compile
        
      File "/Users/[username]/Documents/GitHub/odoo/odoo/tools/cache.py", line 90, in lookup
        value = d[key] = self.method(*args, **kwargs)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/ir_qweb.py", line 113, in compile
        return super(IrQWeb, self).compile(id_or_xml_id, options=options)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/qweb.py", line 323, in compile
        raise QWebException("Error when compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
    odoo.addons.base.models.qweb.QWebException: Name node can't be used with 'None' constant
    Traceback (most recent call last):
      File "/Users/[username]/Documents/GitHub/odoo/odoo/tools/cache.py", line 85, in lookup
        r = d[key]
      File "/Users/[username]/Documents/GitHub/odoo/odoo/tools/func.py", line 69, in wrapper
        return func(self, *args, **kwargs)
      File "/Users/[username]/Documents/GitHub/odoo/odoo/tools/lru.py", line 44, in __getitem__
        a = self.d[obj].me
    KeyError: ('ir.qweb', <function IrQWeb.compile at 0x7f9436306310>, 196, ('en_US', None, None, None, None, None))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/[username]/Documents/GitHub/odoo/odoo/addons/base/models/qweb.py", line 315, in compile
        unsafe_eval(compile(astmod, '<template>', 'exec'), ns)
    ValueError: Name node can't be used with 'None' constant
    
    Error when compiling AST
    ValueError: Name node can't be used with 'None' constant
    Template: web.login
    Path: /t/t/form/input[2]
    Node: <input type="hidden" name="redirect" t-att-value="redirect"/> - - -

我不知道从哪里开始处理这个错误。我查找了 web.login 模板,但没有找到任何内容。

最佳答案

这是 Odoo 中的一个错误。它以前可能很安静,但自从最近版本的 Python 3.8 以来,它现在导致崩溃。您可以暂时降级到早期版本(例如 python-3.8.3),直到 Odoo 修复为止。

更多 here

关于python - 当我尝试运行 Odoo 时,为什么会出现错误 "Name node can' t be use with 'None' Constant”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63349869/

相关文章:

python - 有效地将带有嵌入数组的字典列表转换为 DataFrame

python - 使用 Cython 循环 Numpy 数组

python - Aeroo 报告 : getting error with ir. actions.report.xml.report_type: 'aeroo'

python - 我可以在 OneDrive/Sharepoint 中创建不过期 token 吗?

python - 如何对字段进行约束

python - Pygame 在 Windows 10 上使用 pip install pygame 失败

python - Celery + Redis 任务在不同的文件中

python - 如何获得使用 GridSearchCV 尝试的每个模型的 F1 分数和准确度?

python - 如何更改 Raspberry Pi 中的默认 Python 版本