Stuck in Themes Tutorial
Summary
I followed the tutorial for theming on the website, which is identical to what is found in doc/howtos/themes.rst
. After creating views/pages.xml
and adding it to __manifest__.py
I tried to update the theme and ran into an error (see below: relevant logs).
Steps to reproduce
Follow the tutorial for theming.
What is the current bug behavior?
An error occurs upon attempting to update the theme and see the changes
What is the expected correct behavior?
Expected is a working update so I can follow the next tutorial steps.
Relevant logs and/or screenshots
Error:
Flectra Server Error
Traceback (most recent call last):
File "/opt/flectra/server/flectra/http.py", line 658, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/flectra/server/flectra/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/flectra/server/flectra/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/flectra/server/flectra/http.py", line 700, in dispatch
result = self._call_function(**self.params)
File "/opt/flectra/server/flectra/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/flectra/server/flectra/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/flectra/server/flectra/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/flectra/server/flectra/http.py", line 944, in __call__
return self.method(*args, **kw)
File "/opt/flectra/server/flectra/http.py", line 522, in response_wrap
response = f(*args, **kw)
File "/opt/flectra/server/addons/web/controllers/main.py", line 1094, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/flectra/server/addons/web/controllers/main.py", line 1082, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/flectra/server/flectra/api.py", line 699, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/opt/flectra/server/flectra/api.py", line 690, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/flectra/server/addons/website/models/module.py", line 24, in button_immediate_install
return super(IrModuleModule, self).button_immediate_install()
File "<decorator-gen-42>", line 2, in button_immediate_install
File "/opt/flectra/server/flectra/addons/base/module/module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/opt/flectra/server/flectra/addons/base/module/module.py", line 468, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/flectra/server/flectra/addons/base/module/module.py", line 570, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/flectra/server/flectra/modules/registry.py", line 85, in new
flectra.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/flectra/server/flectra/modules/loading.py", line 380, in load_modules
loaded_modules, update_module, models_to_check)
File "/opt/flectra/server/flectra/modules/loading.py", line 274, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/flectra/server/flectra/modules/loading.py", line 181, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/opt/flectra/server/flectra/modules/loading.py", line 95, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/opt/flectra/server/flectra/tools/convert.py", line 792, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/opt/flectra/server/flectra/tools/convert.py", line 840, in convert_xml_import
relaxng.assert_(doc)
File "src/lxml/lxml.etree.pyx", line 3501, in lxml.etree._Validator.assert_ (src/lxml/lxml.etree.c:184715)
AssertionError: Element flectra has extra content: template, line 4
Possible fixes
When omitting the attribute page="True"
in the template tag of views/pages.xml
the theme does update, but of course then the page page/services
won't be found.
What does work is use the content of pages.xml
from the odoo docs (replacing odoo with flectra tag) which reads like:
<?xml version="1.0" encoding="utf-8" ?>
<flectra>
<!-- === Services Page === -->
<record id="services_page" model="website.page">
<field name="name">Services page</field>
<field name="website_published">True</field>
<field name="url">/services</field>
<field name="type">qweb</field>
<field name="key">theme_tutorial.services_page</field>
<field name="arch" type="xml">
<t t-name="theme_tutorial.services_page_template">
<t t-call="website.layout">
<div id="wrap">
<div class="container">
<h1>Our Services</h1>
<ul class="services">
<li>Cloud Hosting</li>
<li>Support</li>
<li>Unlimited space</li>
</ul>
<!-- === Snippets' area === -->
<div class="oe_structure" />
</div>
</div>
</t>
</t>
</field>
</record>
</flectra>
They add some <record>
and <field>
tags that are not further explained though...