Skip to Content
Menu
This question has been flagged
2 Replies
1348 Views

I have a user who is not an Administrator of Employee module (Odoo 14 Community)

I get following error:

Traceback (most recent call last):
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/opt/odoo/sources/odoo/odoo/http.py", line 682, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 358, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 346, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 911, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 530, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/sources/odoo/addons/web/controllers/main.py", line 1359, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/sources/odoo/addons/web/controllers/main.py", line 1351, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/sources/odoo/odoo/api.py", line 396, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/sources/odoo/odoo/api.py", line 383, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 6183, in onchange
    todo = [
  File "/opt/odoo/sources/odoo/odoo/models.py", line 6186, in <listcomp>
    if name not in done and snapshot0.has_changed(name)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 6018, in has_changed
    return self[name] != record[name]
  File "/opt/odoo/sources/odoo/odoo/models.py", line 5640, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 976, in __get__
    self.compute_value(recs)
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 1115, in compute_value
    records._compute_field_value(self)
  File "/opt/odoo/sources/odoo/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 4035, in _compute_field_value
    getattr(self, field.compute)()
  File "/opt/odoo/sources/odoo/addons/hr_holidays/models/hr_leave.py", line 526, in _compute_number_of_hours_text
    float_round(leave.number_of_hours_display, precision_digits=2),
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 976, in __get__
    self.compute_value(recs)
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 1115, in compute_value
    records._compute_field_value(self)
  File "/opt/odoo/sources/odoo/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 4035, in _compute_field_value
    getattr(self, field.compute)()
  File "/opt/odoo/sources/odoo/addons/hr_holidays/models/hr_leave.py", line 487, in _compute_number_of_hours_display
    calendar = holiday._get_calendar()
  File "/opt/odoo/sources/odoo/addons/hr_holidays/models/hr_leave.py", line 482, in _get_calendar
    return self.employee_id.resource_calendar_id or self.env.company.resource_calendar_id
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 2422, in __get__
    return super().__get__(records, owner)
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 953, in __get__
    recs._fetch_field(self)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3065, in _fetch_field
    self._read(fnames)
  File "/opt/odoo/sources/odoo/addons/hr/models/hr_employee.py", line 134, in _read
    res = self.env['hr.employee.public'].browse(self.ids).read(fields)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3005, in read
    raise ValueError("Invalid field %r on model %r" % (name, self._name))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/odoo/sources/odoo/odoo/http.py", line 638, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 314, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field 'certificates' on model 'hr.employee.public'


When I change user rights to Administrator of Employee module everything works fine.

Avatar
Discard

please check ValueError: Invalid field 'certificates' on model 'hr.employee.public'.

Best Answer

Did you solve this?

Avatar
Discard
Author Best Answer

What do you mean by this? How to do this?

Avatar
Discard