Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Odoo server error : ValueError: Invalid field % in leaf "<osv.ExtendedLeaf: ('%', 'in', ['blabla']) on mail_message (ctx: )>"

By
José DESGRIS
on 2/8/15, 6:59 AM 2,527 views

Hello,

For an unknown reason, I have an error raised on every screen.

Anybody can help ?

Is there any doc on how to debug the server errors ?

Here is the trace : "

Odoo Server Error

Traceback (most recent call last):
  File "/opt/odoo/odoo-server/openerp/http.py", line 524, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo-server/openerp/http.py", line 545, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo-server/openerp/http.py", line 301, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/http.py", line 298, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 761, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 394, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 949, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 941, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 569, in message_read
    message_id_list.insert(0, self._message_read_dict(cr, uid, message_tree[key], context=context))
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 398, in _message_read_dict
    'to_read': message.to_read,
  File "/opt/odoo/odoo-server/openerp/fields.py", line 774, in __get__
    self.determine_value(record)
  File "/opt/odoo/odoo-server/openerp/fields.py", line 867, in determine_value
    record._prefetch_field(self)
  File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3178, in _prefetch_field
    result = records.read(list(fnames), load='_classic_write')
  File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 552, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 823, in read
    res = super(mail_message, self).read(cr, uid, ids, fields=fields, context=context, load=load)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3091, in read
    result = BaseModel.read(records, fields, load=load)
  File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3123, in read
    self._read_from_database(stored)
  File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3287, in _read_from_database
    res2 = self._columns[f].get(cr, self._model, ids, f, user, context=context, values=result)
  File "/opt/odoo/odoo-server/openerp/osv/fields.py", line 1361, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 89, in _get_to_read
    ], context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 1653, in search
    return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4570, in _search
    self._apply_ir_rules(cr, user, query, 'read', context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4447, in _apply_ir_rules
    rule_where_clause, rule_where_clause_params, rule_tables = rule_obj.domain_get(cr, uid, self._name, mode, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/addons/base/ir/ir_rule.py", line 156, in domain_get
    query = self.pool[model_name]._where_calc(cr, SUPERUSER_ID, dom, active_test=False)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4392, in _where_calc
    e = expression.expression(cr, user, domain, self, context)
  File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 646, in __init__
    self.parse(cr, uid, context=context)
  File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 847, in parse
    right_ids = comodel.search(cr, uid, [(path[1], operator, right)], context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/calendar/calendar.py", line 1725, in search
    return super(mail_message, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 1653, in search
    return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/website_mail/models/mail_message.py", line 73, in _search
    context=context, count=count, access_rights_uid=access_rights_uid)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/portal/mail_message.py", line 38, in _search
    context=context, count=count, access_rights_uid=access_rights_uid)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 621, in _search
    context=context, count=count, access_rights_uid=access_rights_uid)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4569, in _search
    query = self._where_calc(cr, user, args, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4392, in _where_calc
    e = expression.expression(cr, user, domain, self, context)
  File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 646, in __init__
    self.parse(cr, uid, context=context)
  File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 812, in parse
    raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'state' in leaf "<osv.ExtendedLeaf: ('state', 'in', ['draft', 'sent', 'cancel']) on mail_message (ctx: )>"

"

Thanks for your help,

José

Hi jose, Please check the field "state" was defined in your xml file.If not please defined that in your view.

Vasanth
on 2/9/15, 1:40 AM

Hi José, have you found any solution for this? If so it would be appreciated to know what you did... Thanks

Aitor Bouzas
on 3/12/15, 3:53 AM

HI jose, are you inheriting mail_message view in your custom module? if yes then just add state field with invisible ="1", in your inherited view. and to get the xml file for this error, in the server console just before this error starts you can see the list of xml file loading, there check for the last *.xml file loading, and there you might get some clue about the error source.

Pawan
on 7/23/15, 1:26 AM
0
Samir Hussein
On 7/22/15, 8:06 PM

Hi José,

go check this issue:

https://www.odoo.com/fr_FR/forum/help-1/question/error-in-messaging-app-valueerror-invalid-field-state-in-leaf-osv-extendedleaf-state-in-draft-sent-cancel-on-mail-message-ctx-65251

I had the same problem (only 2 users had it). It was a filter problem.Check it out and tell me



0
Aitor Bouzas
On 3/12/15, 5:37 AM

Just found a workaround here: https://www.odoo.com/forum/help-1/question/invalid-field-r-in-leaf-r-left-str-leaf-81726

Check it out and tell me if this helped to you.

0
José DESGRIS
On 2/9/15, 7:03 AM

Hello Vasanth,

Glad to see some help on this problem.

I don't know yet how to debug these messages.

I have tried to find the xml file and also the view but I don't know where the file is and also how to modify the view.

I have tried to modify the mail.message.tree view but I hadn't modified this view before and it won't save because of a security reason.

You gave me a good clue but I can't handle it yet.

Edit: I have to say that with a collegue account I did not see any error with internal or mail messages.

Best regards,

José

Hello, I have not resolved the problem yet but it might be that the profile I was using (my account) had messages about an invoice that I roughtly deleted using the top middle delete button. Maybe the reference about the invoice is not in the database any more and I get the error message each time the system tries to get the messages. Best regards.

José DESGRIS
on 2/11/15, 2:29 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/8/15, 6:59 AM
Seen: 2527 times
Last updated: 7/23/15, 1:26 AM