尝试运行Odoo时,为什么会出现错误“名称节点不能与'None'常量一起使用”?

问题描述

我正在尝试按照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,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,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,**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,**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))
    
    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版本。如果假设你在 python3.8 上运行,你应该降级到 python 3.6,正如 Husain Rangwala 在这篇文章 https://www.odoo.com/forum/help-1/valueerror-name-node-can-t-be-used-with-none-constant-template-1105-path-templates-t-t-div-t-t-after-updating-to-python-3-8-5-177836 中解释的那样。要在 Python 版本之间切换,请访问 https://hackersandslackers.com/multiple-versions-python-ubuntu/

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...