'Res.user attribute object loading page Odoo

A mate tried to install some web templates for the backend and got a 503 HTTP error "Service Unavailable" on the browser.

I saw the modules and deleted from ir_module_module table but nothing changed.

The log in debug mode and the error is from qweb when it tries to render the template,

2022-04-22 22:52:50,924 103543 DEBUG odoodb odoo.addons.base.models.assetsbundle: Asset Changed: bundle: web.assets_backend -- version: f36d3f0
2022-04-22 22:52:50,951 103543 INFO odoodb werkzeug: 181.51.154.130 - - [22/Apr/2022 22:52:50] "GET /web HTTP/1.1" 500 - 545 0.329 4.172
2022-04-22 22:52:50,960 103543 ERROR odoodb werkzeug: Error on request:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 219, in render_template
    yield from compiled_fn(self, values, log)
  File "<template_195>", line 169, in template_195
 
  File "<template_195>", line 160, in t_call_content
 
AttributeError: 'res.users' object has no attribute 'sidebar_type'
 
The above exception was the direct cause of the following exception:
 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 811, in dispatch
    r = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 360, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 352, in checked_call
    result.flatten()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1255, in flatten
    self.response.append(self.render())
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1248, in render
    return env["ir.ui.view"]._render_template(self.template, self.qcontext)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1975, in _render_template
    return self.browse(self.get_view_id(template))._render(values, engine)
  File "/usr/lib/python3/dist-packages/odoo/addons/web_editor/models/ir_ui_view.py", line 29, in _render
    return super(IrUiView, self)._render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1983, in _render
    return self.env[engine]._render(self.id, qcontext)
  File "/usr/lib/python3/dist-packages/odoo/addons/web_studio/models/ir_qweb.py", line 44, in _render
    return super(IrQWeb, self)._render(template, values=values, **options)
  File "/usr/lib/python3/dist-packages/odoo/tools/profiler.py", line 289, in _tracked_method_render
    return method_render(self, template, values, **options)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 76, in _render
    result = super()._render(template, values=values, **compile_options)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 134, in _render
    result = ''.join(rendering)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 224, in render_template
    error=e, template=template, path=log.get('last_path_node'), code=code)
Exception
 
The above exception was the direct cause of the following exception:
 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 306, in run_wsgi
    execute(self.server.app)
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 294, in execute
    application_iter = app(environ, start_response)
  File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 110, in application
    return ProxyFix(application_unproxied)(environ, start_response)
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/middleware/proxy_fix.py", line 232, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 87, in application_unproxied
    result = odoo.http.root(environ, start_response)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1314, in __call__
    return self.dispatch(environ, start_response)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1280, in __call__
    return self.app(environ, start_wrapped)
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1508, in dispatch
    result = ir_http._dispatch()
  File "/usr/lib/python3/dist-packages/odoo/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
    return super(Http, cls)._dispatch()
  File "/usr/lib/python3/dist-packages/odoo/addons/web_editor/models/ir_http.py", line 21, in _dispatch
    return super(IrHttp, cls)._dispatch()
  File "/usr/lib/python3/dist-packages/odoo/addons/http_routing/models/ir_http.py", line 515, in _dispatch
    result = super(IrHttp, cls)._dispatch()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 241, in _dispatch
    return cls._handle_exception(e)
  File "/usr/lib/python3/dist-packages/odoo/addons/http_routing/models/ir_http.py", line 611, in _handle_exception
    return super(IrHttp, cls)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 209, in _handle_exception
    return request._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 749, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 302, in _handle_exception
    raise exception.with_traceback(None) from new_cause
odoo.addons.base.models.qweb.QWebException: 'res.users' object has no attribute 'sidebar_type'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 219, in render_template
    yield from compiled_fn(self, values, log)
  File "<template_195>", line 169, in template_195
  File "<template_195>", line 160, in t_call_content
AttributeError: 'res.users' object has no attribute 'sidebar_type'
 
Error when render the template
AttributeError: 'res.users' object has no attribute 'sidebar_type'
Template: 195
Path: /t/t/t[8]
Node: <t t-set="body_sidebar_classname" t-value="'mk_sidebar_type_' + request.env.user.sidebar_type or 'small'"/> - - -

At the end there are the lines that indicates the render template error.

I tried searching the line code of the Node but i cannot find the file.

What can i do to restore Odoo?



Solution 1:[1]

Make a search for sidebar_type in your project (Ctrl + Shift + F)

And if you find it, delete or rename to the correct attribute name.

On a template use this attribute, but maybe it's deleted or renamed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RapThor