This question has been flagged

I have a user with the following access rights:
Accounting : Bookkeeper

Expense: Blank

Employees : Blank

Scenario: We have a 500+ employee construction company. Most of the employees take petty cash from the company and and submit the Expenses by the end of the month. We are handling the petty cash with Odoo default but the issue comes when the expenses are being entered. On behalf of the the normal employees, our accountants are entering the Expenses in Odoo. But these accountants are not allowed to see all the Employees information in Odoo (as per company policy).

When they are trying to select the Employee in the Expense entry screen, I am getting the following error,

Traceback (most recent call last):
  File "/data/build/odoo/odoo/", line 1770, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/data/build/odoo/odoo/service/", line 133, in retrying
    result = func()
  File "/data/build/odoo/odoo/", line 1797, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/data/build/odoo/odoo/", line 2001, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/data/build/odoo/addons/website/models/", line 235, in _dispatch
    response = super()._dispatch(endpoint)
  File "/data/build/odoo/odoo/addons/base/models/", line 222, in _dispatch
    result = endpoint(**request.params)
  File "/data/build/odoo/odoo/", line 725, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/data/build/odoo/addons/web/controllers/", line 24, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/data/build/odoo/addons/web/controllers/", line 20, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/data/build/odoo/odoo/", line 464, in call_kw
    result = _call_kw_model(method, model, args, kwargs)
  File "/data/build/odoo/odoo/", line 435, in _call_kw_model
    result = method(recs, *args, **kwargs)
  File "/data/build/odoo/odoo/", line 1732, in name_search
    ids = self._name_search(name, args, operator, limit=limit, order=self._order)
  File "/data/build/odoo/odoo/", line 1759, in _name_search
    return self._search(domain, limit=limit, order=order)
  File "/data/build/odoo/odoo/", line 5397, in _search
    query = self._where_calc(domain)
  File "/data/build/odoo/odoo/", line 5108, in _where_calc
    return expression.expression(domain, self).query
  File "/data/build/odoo/odoo/osv/", line 788, in __init__
    self.expression = domain_combine_anies(domain, model)
  File "/data/build/odoo/odoo/osv/", line 597, in domain_combine_anies
    domain_any = _anyfy_leaves(domain, model)
  File "/data/build/odoo/odoo/osv/", line 379, in _anyfy_leaves
    raise ValueError(f"Invalid field {model._name}.{path[0]} in leaf {item}")
ValueError: Invalid field hr.employee.public.filter_for_expense in leaf ('filter_for_expense', '=', True)

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    at makeErrorFromResponse (
    at XMLHttpRequest. (

I have tested this in runbot also. Same error. What's the solution/alternative on this?

Best Answer

another way is  -  Say for  X employee - Accountant name is  Y.

So  Employee Module, for X  make  Y as manager 

Note :  Only  Y can do expenses on behalf of  X


Actually, the Manager details we need to keep because multiple projects are going on at the same time. To keep the organizational structure proper, we can't change the manager.

Best Answer

If you are an Odoo Enterprise customer you can report bugs via an Odoo Support ticket which you can create at - as this forum is for User to User support.


thanks, I did.