Reputation: 57
At the moment I am working on an addon for the timesheet_grid module for odoo13. I came across this problem, cant find any solution. I think it says the view name is already taken, is this right ?
My code
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="timesheet_view_grid_addon_by_project" model="ir.ui.view">
<field name="name">timesheet.view.grid.by.project.addon</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="timesheet_grid.timesheet_view_grid_by_project"/>
<grid string="Timesheets" adjustment="object" adjust_name="adjust_grid">
<xpath expr="//field[@name='project_id']" position="replace">
<field name="project_id" type="row" section="1" color="blue !important"/>
</xpath>
</grid>
</record>
</odoo>
Error Message:
Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 350, 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 339, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 915, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1331, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1319, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-60>", line 2, in button_immediate_install
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 421, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 313, in load_marked_modules
loaded, processed = load_module_graph(
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 225, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package, report=report)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 68, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 736, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 786, in convert_xml_import
relaxng.assert_(doc)
File "src/lxml/etree.pyx", line 3631, in lxml.etree._Validator.assert_
**AssertionError: Element odoo has extra content: record, line 5**
As I said i think it´s something with the View ID, isnt it? I tried changing the name but no luck. Thank you I would appreciate any help or advices. for-loop
Upvotes: 0
Views: 119
Reputation: 1155
Your xml missing one node.
With missing node:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="timesheet_view_grid_addon_by_project" model="ir.ui.view">
<field name="name">timesheet.view.grid.by.project.addon</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="timesheet_grid.timesheet_view_grid_by_project"/>
<field name="arch" type="xml">
<grid string="Timesheets" adjustment="object" adjust_name="adjust_grid">
<xpath expr="//field[@name='project_id']" position="replace">
<field name="project_id" type="row" section="1" color="blue !important"/>
</xpath>
</grid>
</field>
</record>
</odoo>
Upvotes: 1