Skip to Content
Menu
This question has been flagged
1 Reply
2941 Views

I am getting the following server error when I try to install or update any modules. From what I can gather there is something wrong with one of my views, but I can't tell which one?

Brad


Odoo Server Error

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 530, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 567, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 303, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 300, in checked_call

return self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 796, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 396, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 940, in call_button

action = self._call_kw(model, method, args, {})

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 928, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/module.py", line 537, in button_immediate_upgrade

return self._button_immediate_function(cr, uid, ids, self.button_upgrade, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/module.py", line 498, in _button_immediate_function

registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)

File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 368, in new

openerp.modules.load_modules(registry._db, force_demo, status, update_module)

File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 355, in load_modules

loaded_modules, update_module)

File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 255, in load_marked_modules

loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)

File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 176, in load_module_graph

_load_data(cr, module_name, idref, mode, kind='data')

File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 118, in _load_data

tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)

File "/usr/lib/python2.7/dist-packages/openerp/tools/convert.py", line 901, in convert_file

convert_xml_import(cr, module, fp, idref, mode, noupdate, report)

File "/usr/lib/python2.7/dist-packages/openerp/tools/convert.py", line 987, in convert_xml_import

obj.parse(doc.getroot(), mode=mode)

File "/usr/lib/python2.7/dist-packages/openerp/tools/convert.py", line 853, in parse

self._tags[rec.tag](self.cr, rec, n, mode=mode)

File "/usr/lib/python2.7/dist-packages/openerp/tools/convert.py", line 827, in _tag_template

return self._tag_record(cr, record, data_node)

File "/usr/lib/python2.7/dist-packages/openerp/tools/convert.py", line 763, in _tag_record

id = self.pool['ir.model.data']._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_model.py", line 1077, in _update

res_id = model_obj.create(cr, uid, values, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_ui_view.py", line 264, in create

context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 336, in old_api

result = method(recs, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4059, in create

record = self.browse(self._create(old_vals))

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 462, in new_api

result = method(self._model, cr, uid, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4250, in _create

recs._validate_fields(vals)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 1267, in _validate_fields

raise ValidationError('\n'.join(errors))

ParseError: "ValidateError

Field(s) `arch` failed against a constraint: Invalid view definition

Error details:

Element '<xpath expr="//script[contains(@id, 'tracking_code')]">' cannot be located in parent view

Error context:

View `website_AB assets`

[view_id: 1220, xml_id: n/a, model: n/a, parent_id: 353]" while parsing None:37, near

<data name="website_AB assets" inherit_id="website.layout">

<xpath expr="//script[contains(@id, 'tracking_code')]" position="replace">

<script id="tracking_code" t-if="website and website.google_analytics_key and not editable">

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', _.str.trim('<t t-esc="website.google_analytics_key"/>'), 'auto');

ga_google_analytics_data = <t t-raw="json.dumps(website.google_analytics_data(main_object))"/>;

for(i in ga_google_analytics_data) {

ga('set', i, ga_google_analytics_data[i]);

}

ga('send','pageview');

</script>

</xpath>

</data>

Avatar
Discard
Best Answer

The error is:

Error details:
Element '<xpath expr="//script[contains(@id, 'tracking_code')]">' cannot be located in parent view

Just locate the view that contains that xpath to fix it. In the default Odoo there is no such template extension for the website.layout to add something that match that expression. If you have installed another module then you need to put into depends to ensure that the extension is in loaded when you view is parsed

Avatar
Discard
Related Posts Replies Views Activity
0
Jun 24
423
1
Dec 22
2116
3
Oct 24
354
1
Dec 19
2190
1
Apr 23
18719