This question has been flagged
2 Replies
2789 Views

when it comes to working with domains, I often get  the error, `Invalid leaf in expression`  I still dont get what are leafs in odoo, can anyone explain it please, 

Thank's in advance

Avatar
Discard
Author Best Answer

@Niyas Raphy

Yes, that's kinda obvious, My question was what exactly do they mean by leaf in domains, is it the operator, the model filed or the syntax ? 

well here is the answere from odoo code a methode that checks if a leaf is a leaf, the documentation is kinda good for for this function, 

def is_leaf(element, internal=False):
""" Test whether an object is a valid domain term:
- is a list or tuple
- with 3 elements
- second element if a valid op

:param tuple element: a leaf in form (left, operator, right)
:param boolean internal: allow or not the 'inselect' internal operator
in the term. This should be always left to False.
Avatar
Discard

Nice to see it, upvote (y)

Best Answer

Hi,

If there is some mistakes with the domain given you will get such message. Make sure that the domain is given properly.


Thanks

Avatar
Discard