Hi everyone, i think it's because odoo don't find my class but i don't know how to fix it.
Here is my error:
Erreur:
Odoo Server Error
Traceback (most recent call last):
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 744, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 572, in _tag_record
model = self.env[rec_model]
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\api.py", line 760, in __getitem__
return self.registry[model_name]._browse((), self)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\modules\registry.py", line 181, in __getitem__
return self.models[model_name]
KeyError: 'project.data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\http.py", line 650, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\pycompat.py", line 87, in reraise
raise value
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\http.py", line 692, in dispatch
result = self._call_function(**self.params)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\service\model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\http.py", line 936, in __call__
return self.method(*args, **kw)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\http.py", line 515, in response_wrap
response = f(*args, **kw)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\addons\web\controllers\main.py", line 935, in call_button
action = self._call_kw(model, method, args, {})
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\addons\web\controllers\main.py", line 923, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-46>", line 2, in button_immediate_upgrade
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\addons\base\module\module.py", line 71, in check_and_log
return method(self, *args, **kwargs)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\addons\base\module\module.py", line 602, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\addons\base\module\module.py", line 541, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\modules\registry.py", line 85, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\modules\loading.py", line 339, in load_modules
force, status, report, loaded_modules, update_module)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\modules\loading.py", line 242, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\modules\loading.py", line 159, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='demo')
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\modules\loading.py", line 94, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 791, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 852, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 741, in parse
self.parse(rec, mode)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 751, in parse
exc_info[2]
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 744, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\convert.py", line 572, in _tag_record
model = self.env[rec_model]
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\api.py", line 760, in __getitem__
return self.registry[model_name]._browse((), self)
File "C:\Program Files (x86)\Odoo 11.0\server\odoo\modules\registry.py", line 181, in __getitem__
return self.models[model_name]
odoo.tools.convert.ParseError: "project.data" while parsing file:/c:/program files (x86)/odoo 11.0/server/odoo/addons/project/data/project_demo.xml:25, near
<record id="project_data_00" model="project.data">
<field name="name">Test_24</field>
</record>
Here is my class from project:
class ProjectData(models.Model):
_name = "project.data"
_description = "Data on the sinister"
name = fields.Char(required=True)
Here is my record in project:
<record id="project_data_00" model="project.data">
<field name="name">Test_24</field>
</record>
<record id="project_task_11" model="project.task">
<field name="planned_hours" eval="16.0"/>
<field name="remaining_hours" eval="16.0"/>
<field name="user_id" ref="base.user_root"/>
<field name="priority">1</field>
<field name="project_id" ref="project.project_project_2"/>
<field name="name">User interface improvements</field>
<field name="tag_ids" eval="[(6, 0, [
ref('project.project_tags_01'),
ref('project.project_tags_03')])]"/>
<field name="stage_id" ref="project_stage_1"/>
<field name="data_id" eval="project.project_data_00"/>
</record>
Does anyone can help me pls?
Did you call the python file in the init? Also make sure that you have restarted the service
yes i did and how do I restart the service?