This question has been flagged
8 Replies
6472 Views

After editing views from Technical (Login Layout - web.login_layout) i set its Inherited View with Web layout - web.layout. I couldnt login to the database & its showing like this (traceback attached below). How to fix this?

I'm  working on Odoo 10.0 CE (Ubuntu 18.04.1 LTS)

Thanks :)


500: Internal Server Error
Error

Error message:

load could not load template
Template: web.layout

Traceback

Traceback (most recent call last):
  File "/opt/odoo/addons/website/models/ir_http.py", line 274, in _handle_exception
    response = super(Http, cls)._handle_exception(exception)
  File "/opt/odoo/odoo/addons/base/ir/ir_http.py", line 169, in _handle_exception
    return request._handle_exception(exception)
  File "/opt/odoo/odoo/http.py", line 775, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo/addons/base/ir/ir_http.py", line 195, in _dispatch
    result = request.dispatch()
  File "/opt/odoo/odoo/http.py", line 834, in dispatch
    r = self._call_function(**self.params)
  File "/opt/odoo/odoo/http.py", line 334, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo/http.py", line 330, in checked_call
    result.flatten()
  File "/opt/odoo/odoo/http.py", line 1277, in flatten
    self.response.append(self.render())
  File "/opt/odoo/odoo/http.py", line 1270, in render
    return env["ir.ui.view"].render_template(self.template, self.qcontext)
  File "/opt/odoo/addons/app_odoo_customize/models/ir_ui_view.py", line 18, in render_template
    return super(View, self).render_template(template, values=values, engine=engine)
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1049, in render_template
    return self.browse(self.get_view_id(template)).render(values, engine)
  File "/opt/odoo/addons/website/models/ir_ui_view.py", line 115, in render
    return super(View, self).render(values, engine=engine)
  File "/opt/odoo/addons/web_editor/models/ir_ui_view.py", line 26, in render
    return super(IrUiView, self).render(values=values, engine=engine)
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1069, in render
    return self.env[engine].render(self.id, qcontext)
  File "/opt/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 53, in render
    return super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
  File "/opt/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 249, in render
    self.compile(template, options)(self, body.append, values or {})
  File "/opt/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 318, in _compiled_fn
    raise e
QWebException: None
Traceback (most recent call last):
  File "/opt/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 342, in get_template
    document = options.get('load', self.load)(template, options)
  File "/opt/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 81, in load
    template = env['ir.ui.view'].read_template(name)
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 944, in read_template
    return self._read_template(self.get_view_id(xml_id))
  File "<decorator-gen-9>", line 2, in _read_template
  File "/opt/odoo/odoo/tools/cache.py", line 87, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 935, in _read_template
    arch = self.browse(view_id).read_combined(['arch'])['arch']
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 674, in read_combined
    arch = self.apply_view_inheritance(arch_tree, root.id, self.model)
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 623, in apply_view_inheritance
    source = self.apply_inheritance_specs(source, specs_tree, view_id)
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 601, in apply_inheritance_specs
    self.raise_view_error(_("Element '%s' cannot be located in parent view") % tag, inherit_id)
  File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 474, in raise_view_error
    raise ValueError(message)
ValueError: Element '<t name="Web layout" t-name="web.layout">' cannot be located in parent view

Error context:
View `Web layout`
[view_id: 165, xml_id: web.layout, model: n/a, parent_id: 166]

load could not load template
Template: web.layout



Avatar
Discard

Next time please use a meaningful title related to the content of your error message.

Best Answer

Dear Felix,

Please try to update the module web and website using the terminal.

python /opt/odoo/odoo-bin -d <database name> -u web -r <conf file>

If website is install:

python /opt/odoo/odoo-bin -d <database name> -u website -r <conf file>

regards

Nikhilkrishnan

Avatar
Discard
Author Best Answer

@Nikhilkrishnan thanks for your response. is -r (conf file) is this file:
/etc/odoo-server.conf

i put my line like this:

python /opt/odoo/odoo-bin -d Silor_Beta2 -u website -r /etc/odoo-server.conf

which: Silor_Beta2 is the database i want to update, and website is the module

I ran it, and heres the result:

Running as user 'root' is a security risk.
2019-02-07 19:41:02,967 5858 INFO ? odoo: Odoo version 10.0
2019-02-07 19:41:02,967 5858 INFO ? odoo: addons paths: ['/root/.local/share/Odoo/addons/10.0', u'/opt/odoo/odoo/add
ons', u'/opt/odoo/addons']
2019-02-07 19:41:02,968 5858 INFO ? odoo: database: /etc/odoo-server.conf@default:default
2019-02-07 19:41:02,969 5858 INFO ? odoo.sql_db: Connection to the database failed
Traceback (most recent call last):
  File "/opt/odoo/odoo-bin", line 9, in <module>
    odoo.cli.main()
  File "/opt/odoo/odoo/cli/command.py", line 64, in main
    o.run(args)File "/opt/odoo/odoo/cli/server.py", line 175, in run
    main(args)
  File "/opt/odoo/odoo/cli/server.py", line 140, in main
    odoo.service.db._create_empty_database(db_name)
  File "/opt/odoo/odoo/service/db.py", line 82, in _create_empty_database
    with closing(db.cursor()) as cr:
  File "/opt/odoo/odoo/sql_db.py", line 635, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
  File "/opt/odoo/odoo/sql_db.py", line 177, in __init__
    self._cnx = pool.borrow(dsn)
  File "/opt/odoo/odoo/sql_db.py", line 518, in _locked
File "/opt/odoo/odoo/sql_db.py", line 586, in borrow
    **connection_info)
  File "/usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "/etc/odoo-server.conf" does not exist


anything wrong with it?



Avatar
Discard

Run the command as Odoo user.

Author

Hi Ermin, i ran the command as Odoo user then in followed @Nikhil Krishnan solution, but still I couldnt login to the database. Is there any way that i can edit the Views (Web layout - web.layout) through command line (database)? Because before i edited Views from Technical (Login Layout - web.login_layout) i set its Inherited View with Web layout - web.layout.

ok, you try to update the base module too.

Author

Dear Nikhil,

I tried to update the web, website & base module, but still error. Is there any way to remove the inherited view i assigned in User Interface from Database? I assume that i assigned web.layout as inherited view in web.login_layout (as the error said above).