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

hi all , i cant start my odoo server , i installed one hr_emp_id module yesterday then i removed it but it didnt reflect on my hr_emp module , now today when i start the server iam encountering this problem , someone please help .


2020-03-28 08:01:27,761 3971 ERROR odoo odoo.modules.registry: Failed to load registry 

Traceback (most recent call last):

  File "/odoo/odoo-server/odoo/modules/registry.py", line 60, in __new__

    return cls.registries[db_name]

  File "/odoo/odoo-server/odoo/tools/func.py", line 69, in wrapper

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

  File "/odoo/odoo-server/odoo/tools/lru.py", line 44, in __getitem__

    a = self.d[obj].me

KeyError: 'odoo'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  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 437, in load_modules

    registry.setup_models(cr)

  File "/odoo/odoo-server/odoo/modules/registry.py", line 255, in setup_models

    model._setup_fields()

  File "/odoo/odoo-server/odoo/models.py", line 2681, in _setup_fields

    field.setup_full(self)

  File "/odoo/odoo-server/odoo/fields.py", line 433, in setup_full

    self._setup_related_full(model)

  File "/odoo/odoo-server/odoo/fields.py", line 494, in _setup_related_full

    raise TypeError("Type of related field %s is inconsistent with %s" % (self, field))

TypeError: Type of related field hr.employee.employee_id is inconsistent with resource.resource.name

2020-03-28 08:01:27,763 3971 INFO odoo werkzeug: 127.0.0.1 - - [28/Mar/2020 08:01:27] "GET /favicon.ico HTTP/1.1" 500 - 13 0.014 0.561

2020-03-28 08:01:27,770 3971 ERROR odoo werkzeug: Error on request:

Traceback (most recent call last):

  File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 270, in run_wsgi

    execute(self.server.app)

  File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 258, in execute

    application_iter = app(environ, start_response)

  File "/odoo/odoo-server/odoo/service/server.py", line 439, in app

    return self.app(e, s)

  File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 142, in application

    return application_unproxied(environ, start_response)

  File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 117, in application_unproxied

    result = odoo.http.root(environ, start_response)

  File "/odoo/odoo-server/odoo/http.py", line 1282, in __call__

    return self.dispatch(environ, start_response)

  File "/odoo/odoo-server/odoo/http.py", line 1252, in __call__

    return self.app(environ, start_wrapped)

  File "/usr/local/lib/python3.6/dist-packages/werkzeug/wsgi.py", line 766, in __call__

    return self.app(environ, start_response)

  File "/odoo/odoo-server/odoo/http.py", line 1434, in dispatch

    odoo.registry(db).check_signaling()

  File "/odoo/odoo-server/odoo/__init__.py", line 104, in registry

    return modules.registry.Registry(database_name)

  File "/odoo/odoo-server/odoo/modules/registry.py", line 62, in __new__

    return cls.new(db_name)

  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 437, in load_modules

    registry.setup_models(cr)

  File "/odoo/odoo-server/odoo/modules/registry.py", line 255, in setup_models

    model._setup_fields()

  File "/odoo/odoo-server/odoo/models.py", line 2681, in _setup_fields

    field.setup_full(self)

  File "/odoo/odoo-server/odoo/fields.py", line 433, in setup_full

    self._setup_related_full(model)

  File "/odoo/odoo-server/odoo/fields.py", line 494, in _setup_related_full

    raise TypeError("Type of related field %s is inconsistent with %s" % (self, field))

TypeError: Type of related field hr.employee.employee_id is inconsistent with resource.resource.name - - -


Avatar
Discard
Best Answer

Hi, Guna

Regarding the "TypeError: Type of related field hr.employee.employee_id is inconsistent with resource.resource.name - - -" issues:

This issue occurs when you defined wrong type inside the related type field and as I show your last post and solution is given below

employee_id = fields.Integer(string="Employee Id",related='resource_id.name', store=True, readonly=False, tracking=True )

Name is a character type field in the Resource model, So you need to replace this line with the below line

employee_id = fields.Char(string="Employee Id",related='resource_id.name', store=True, readonly=False, tracking=True )

After do these changes restart your Odoo server then upgrade your custom module. If you still have the same issue then try to upgrade using command line,

/odoo-bin -c config.py -d databasename -u modulename
Feel free to ask in case you have any confusion related to the above point.


Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited
Avatar
Discard