Server error when updating custom module fromOdoo-10 to Odoo-15 - python

I'm trying to update custom module from Odoo v10 to v15.
When I try to install module I get following error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 85, in lookup
r = d[key]
File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 71, in wrapper
return func(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7f93db198a60>, 'web.assets_backend')
During handling of the above exception, another exception occurred:
Traceback (most recAent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 680, in _tag_root
f(rec)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 658, in _tag_template
return self._tag_record(record)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 567, in _tag_record
f_val = self.id_get(f_ref)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 663, in id_get
res = self.model_id_get(id_str, raise_if_not_found)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 669, in model_id_get
return self.env['ir.model.data']._xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 1943, in _xmlid_to_res_model_res_id
return self._xmlid_lookup(xmlid)[1:3]
File "<decorator-gen-35>", line 2, in _xmlid_lookup
File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 1936, in _xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: web.assets_backend
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 687, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, 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 348, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 916, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 535, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1347, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1335, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 464, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 451, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-74>", line 2, in button_immediate_install
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 483, 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 600, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 474, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 363, in load_marked_modules
loaded, processed = load_module_graph(
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 745, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 811, in convert_xml_import
obj.parse(doc.getroot())
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 731, in parse
self._tag_root(de)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 693, in _tag_root
raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing None:4, somewhere inside
<data name="web_timeline assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/web_timeline/static/lib/vis/vis-timeline-graph2d.min.css"/>
<link rel="stylesheet" href="/web_timeline/static/src/css/web_timeline.css"/>
<script type="text/javascript" src="/web_timeline/static/lib/vis/vis-timeline-graph2d.min.js"/>
<script type="text/javascript" src="/web_timeline/static/src/js/web_timeline.js"/>
</xpath>
</data>
I have added in manifest file following code but it didn't help:
'assets': {
'web.assets_backend': [
'web_timeline/static/src/js/web_timeline.js',
],
'web.assets_common': [
'web_timeline/static/lib/vis/vis-timeline-graph2d.min.css',
'web_timeline/static/src/css/web_timeline.css',
'web_timeline/static/lib/vis/vis-timeline-graph2d.min.js',
]
}
I'm new to Odoo and can't figure out this error stack, I thought those js files had to be put in assets bundle.
Any help would be appreciated, thank you.

From v15, Odoo removed the support of pushing assets using the view web.assets_backend , web.assets_frontend etc.
So, you're right importing those files through the manifest, but you should still remove the call to the view that extends web.assets_backend etc.
You can try by simply commenting out the call to that view (e.g. views/assets.xml or something? :) ) in the manifest.
Keep me updated if you need more help

Related

How to relation two field from differents models in Odoo or OpenERP?

I want to know how to relation 2 CHAR Fields by code in Odoo.
First field is in product.template the HS CODE and the other one is in account.invoice.line and is a custom field.
How can I do this?
I have this error message
Error:
Odoo Server Error
Traceback (most recent call last):
File "/home/ubuntu/OdooAddons/odoo/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/ubuntu/OdooAddons/odoo/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/ubuntu/OdooAddons/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/ubuntu/OdooAddons/odoo/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/home/ubuntu/OdooAddons/odoo/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/ubuntu/OdooAddons/odoo/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/home/ubuntu/OdooAddons/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/home/ubuntu/OdooAddons/odoo/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File "/home/ubuntu/OdooAddons/odoo/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/home/ubuntu/OdooAddons/odoo/addons/web/controllers/main.py", line 967, in call_button
action = self._call_kw(model, method, args, {})
File "/home/ubuntu/OdooAddons/odoo/addons/web/controllers/main.py", line 955, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/ubuntu/OdooAddons/odoo/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/home/ubuntu/OdooAddons/odoo/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-67>", line 2, in button_immediate_upgrade
File "/home/ubuntu/OdooAddons/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/home/ubuntu/OdooAddons/odoo/odoo/addons/base/models/ir_module.py", line 627, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "/home/ubuntu/OdooAddons/odoo/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/ubuntu/OdooAddons/odoo/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/ubuntu/OdooAddons/odoo/odoo/modules/loading.py", line 417, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/home/ubuntu/OdooAddons/odoo/odoo/modules/loading.py", line 313, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/home/ubuntu/OdooAddons/odoo/odoo/modules/loading.py", line 194, in load_module_graph
registry.setup_models(cr)
File "/home/ubuntu/OdooAddons/odoo/odoo/modules/registry.py", line 275, in setup_models
model._setup_fields()
File "/home/ubuntu/OdooAddons/odoo/odoo/models.py", line 2656, in _setup_fields
field.setup_full(self)
File "/home/ubuntu/OdooAddons/odoo/odoo/fields.py", line 520, in setup_full
self._setup_related_full(model)
File "/home/ubuntu/OdooAddons/odoo/odoo/fields.py", line 563, in _setup_related_full
field = target._fields[name]
KeyError: 'hs_code'
Thanks
The solution was to add the delivery_hs_code module to the depends entry in the manifest file.
Thank you Kenly

Unable to install "MRP" module in Odoo Community 14

I'm unable to install Manufacturing Resource Planning (MRP) module in Odoo Community 14.
I receive error message below:
Odoo Server Error
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 682, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 358, 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 346, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 911, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 530, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1363, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1351, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 396, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 383, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-72>", line 2, in button_immediate_install
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 73, in check_and_log
return method(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 474, 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 592, 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 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 455, in load_modules
loaded_modules, update_module, models_to_check)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 221, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 733, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 799, in convert_xml_import
obj.parse(doc.getroot())
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 719, in parse
self._tag_root(de)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 684, in _tag_root
etree.tostring(rec, encoding='unicode').rstrip()
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 638, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 314, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /usr/lib/python3/dist-packages/odoo/addons/mrp/data/mrp_data.xml:17, near
<record id="stock.warehouse0" model="stock.warehouse">
<field name="manufacture_to_resupply" eval="True"/>
</record>
Did I forget to configure something (route, ...) specific?
I run Odoo Community 14 containerized, based on official Docker image.
Thanks in advance for help!

Char field related KeyError 'work_location'

I'm working with employee data such as in python:
employee_id = fields.Many2one('hr.employee', string="Работник")
work_location = fields.Char(related='employee_id.work_location', string="Место трудоустройства")
in xml
<field name="work_location"/>
when I uninstal and then install module it's ok but when i change somesing even in xml and try to update module I have an error
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/http.py", line 619, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo13/odoo/odoo/http.py", line 309, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo13/odoo/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/opt/odoo13/odoo/odoo/http.py", line 664, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo13/odoo/odoo/http.py", line 345, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/service/model.py", line 93, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/http.py", line 338, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 909, in __call__
return self.method(*args, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 510, in response_wrap
response = f(*args, **kw)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1323, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1311, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 395, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 382, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-64>", line 2, in button_immediate_upgrade
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_module.py", line 629, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo13/odoo/odoo/modules/registry.py", line 85, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo13/odoo/odoo/modules/loading.py", line 416, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/opt/odoo13/odoo/odoo/modules/loading.py", line 312, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/odoo13/odoo/odoo/modules/loading.py", line 194, in load_module_graph
registry.setup_models(cr)
File "/opt/odoo13/odoo/odoo/modules/registry.py", line 247, in setup_models
model._setup_fields()
File "/opt/odoo13/odoo/odoo/models.py", line 2675, in _setup_fields
field.setup_full(self)
File "/opt/odoo13/odoo/odoo/fields.py", line 405, in setup_full
self._setup_related_full(model)
File "/opt/odoo13/odoo/odoo/fields.py", line 458, in _setup_related_full
field = target._fields[name]
KeyError: 'work_location'
I dont use work_location anywhere else. I can't get what I did wrong. (sorry for bad english)
It seems use of dependency module is missing in your custom module manifest file. Make sure you have added hr module in it. Like
'depends': ['hr']

Error Installation MRO by CodUP module on Odo 12.0

I try to install MRO module but I get this error
Error:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/tools/convert.py", line 757, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 573, in _tag_record
model = self.env[rec_model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
KeyError: 'procurement.rule'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 653, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/odoo/odoo-server/odoo/http.py", line 695, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/http.py", line 938, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/odoo/odoo-server/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 749, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 736, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-61>", line 2, in button_immediate_install
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 71, in check_and_log
return method(self, *args, **kwargs)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 442, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 535, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 426, in load_modules
loaded_modules, update_module, models_to_check)
File "/odoo/odoo-server/odoo/modules/loading.py", line 318, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/odoo/odoo-server/odoo/modules/loading.py", line 224, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package, report=report)
File "/odoo/odoo-server/odoo/modules/loading.py", line 68, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
File "/odoo/odoo-server/odoo/tools/convert.py", line 801, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/odoo/odoo-server/odoo/tools/convert.py", line 864, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 754, in parse
self.parse(rec, mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 763, in parse
exc_info[2]
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "/odoo/odoo-server/odoo/tools/convert.py", line 757, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 573, in _tag_record
model = self.env[rec_model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
odoo.tools.convert.ParseError: "procurement.rule" while parsing /odoo/odoo- server/addons/mro/mro_data.xml:59, near
<record id="rule_wh_asset" model="procurement.rule">
<field name="name">WH: Stock -> Asset</field>
<field name="action">move</field>
<field name="picking_type_id" ref="stock.picking_type_internal"/>
<field name="location_src_id" ref="stock.stock_location_stock"/>
<field name="location_id" ref="asset.stock_location_assets"/>
<field name="route_id" ref="mro.route_maintenance"/>
</record>
I installed asset module as dependencies but nothing change
OS Debian 9
same installation but Odoo 11.0
works fine
same installation but Odoo 10.0
works fine
also tried to uninstall, purge and reinstall but nothing change new
Can anyone help me or have any idea to solve the problem pleas
waithing for your reply
thanks
regards
MD
Welcome to Stack Overflow Maudal78!
The procurement.rule has been renamed to stock.rule in Odoo v12. This is why the old code does not work in Odoo 12. See commit https://github.com/odoo/odoo/commit/827958a8902589246dd741341ce1bc5465059909 for details.
You, CodUp team or someone need to make changes to the module for it to be compatible. There already is a branch for Odoo 12.0 in the module’s repo at https://github.com/codup/odoo-eam, but it does not contain changes for this.

Odoo 11 Element '<page name="extra_info">' cannot be located in parent view

I am trying/learning Odoo 11.
I am only interested in Projects Module but I've install CRM, Repair and many more just to see what they do. An error occurs when I try to uninstall them and I receive the following trace:
Error:
Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/models.py", line 971, in _validate_fields
check(self)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 316, in _check_xml
view_def = view.read_combined(['arch'])
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 700, in read_combined
arch = self.apply_view_inheritance(arch_tree, root.id, self.model)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 649, in apply_view_inheritance
source = self.apply_inheritance_specs(source, specs_tree, view_id)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 627, in apply_inheritance_specs
self.raise_view_error(_("Element '%s' cannot be located in parent view") % tag, inherit_id)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 489, in raise_view_error
raise ValueError(message)
ValueError: Element '<page name="extra_info">' cannot be located in parent view
Error context:
View `project.task.form.view`
[view_id: 1190, xml_id: n/a, model: project.task, parent_id: 440]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 741, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 651, in _tag_record
id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_model.py", line 1467, in _update
record = record.create(values)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 384, in create
return super(View, self).create(self._compute_defaults(values))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3289, in create
self._fields[key].determine_inverse(record)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1045, in determine_inverse
getattr(records, self.inverse)()
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 253, in _inverse_arch
view.write(data)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 400, in write
return super(View, self).write(self._compute_defaults(vals))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3011, in write
self._write(old_vals)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3164, in _write
self._validate_fields(vals)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 975, in _validate_fields
raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.exceptions.ValidationError: ('Error while validating constraint\n\nElement \'<page name="extra_info">\' cannot be located in parent view\n\nError context:\nView `project.task.form.view`\n[view_id: 1190, xml_id: n/a, model: project.task, parent_id: 440]', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 648, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 309, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 86, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 685, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 341, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 334, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 929, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 514, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 920, in call_button
action = self._call_kw(model, method, args, {})
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 908, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/module/wizard/base_module_uninstall.py", line 55, in action_uninstall
return modules.button_immediate_uninstall()
File "<decorator-gen-42>", line 2, in button_immediate_uninstall
File "/usr/lib/python3/dist-packages/odoo/addons/base/module/module.py", line 70, in check_and_log
return method(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/module/module.py", line 555, in button_immediate_uninstall
return self._button_immediate_function(type(self).button_uninstall)
File "/usr/lib/python3/dist-packages/odoo/addons/base/module/module.py", line 530, 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 84, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 341, in load_modules
loaded_modules, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 240, 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/python3/dist-packages/odoo/modules/loading.py", line 156, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 94, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 788, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 849, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 748, in parse
exc_info[2]
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 85, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 741, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 651, in _tag_record
id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_model.py", line 1467, in _update
record = record.create(values)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 384, in create
return super(View, self).create(self._compute_defaults(values))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3289, in create
self._fields[key].determine_inverse(record)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1045, in determine_inverse
getattr(records, self.inverse)()
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 253, in _inverse_arch
view.write(data)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_ui_view.py", line 400, in write
return super(View, self).write(self._compute_defaults(vals))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3011, in write
self._write(old_vals)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3164, in _write
self._validate_fields(vals)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 975, in _validate_fields
raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.tools.convert.ParseError: "Error while validating constraint
Element '<page name="extra_info">' cannot be located in parent view
Error context:
View `project.task.form.view`
[view_id: 1190, xml_id: n/a, model: project.task, parent_id: 440]
None" while parsing /usr/lib/python3/dist-packages/odoo/addons/task_check_list/views/project_task_view.xml:4, near
<record model="ir.ui.view" id="view_task_form2_inherit_form_view">
<field name="name">project.task.form.view</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<page name="extra_info" position="after">
<page name="checklist" string="Checklist">
<group>
<group string="Checklist">
<field name="task_checklist" widget="many2many_checkboxes"/>
</group>
<group string="Completed">
<field name="checklist_progress" widget="percentpie"/>
</group>
</group>
</page>
</page>
</field>
</record>
I an not a python developer and I've not yet gained an understanding of the internal structure of Odoo or OpenERP to really be able to fix anything. The only thing I did is I added a date_start field in Projects -> Task box in the kanban view via Odoo's internal editor.
I've already read similar question here and on Reddit but it did not get me anywhere.
Uninstalling can sometimes be a mess. Odoo views can be inherited and extended by XPath expressions (directly and indirectly).
Somehow you've uninstalled a module, which view definition for model project.task depends on another view, which is to be deleted upon uninstallation of a module.
You didn't make a mistake here, but Odoo itself by uninstalling modules either the wrong order or there is just a wrong module dependency anywhere in project apps/modules.
Try to cancel the module/app uninstallation (you have to open up every module and click that button...) and then uninstall the module task_check_list, where this error comes from.

Categories