Why do I get the error "Name node can't be used with 'None' constant" when I try to run Odoo?

Viewed 4167

I am trying to setup odoo on my mac by following the instructions linked on the github page. When starting the server using this command:

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

The server starts and I see one database "mydb" on the odoo splash page. Then when I click that database I get the following error:

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"/> - - -

I don't know where to start with this error. I have looked up the web.login template and didnt find anything.

2 Answers

This is a bug in Odoo. It was probably silent before but it is now causing a crash since a recent version of Python 3.8. You could downgrade to an earlier version (like python-3.8.3) temporarily until Odoo is fixed.

More here

Related