Odoo Help


Problem with column iteration in domain filter

on 10/2/13, 5:34 AM 1,366 views

I have 2 classes "class" and "student" where the relation between them is one2many. i.e one class will have many students

Then the third class to map where i need to make an entry by selecting one class and selecting one student. So i would like to filter students only that of the class selected.

I implemented the below domain filter

<field name="class"/> # many2one field
<field name="student" domain="[('student.cols.id','=',class)]"/>  # many2one field where cols is the many2one field to class "class". In the right side i am able to get the id correct

It fails with the below error message

raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))

Kindly clarify. Thanks for your time

On 10/3/13, 1:49 PM

This works great for me

<field name="student" domain="[('cols'=',class)]"/>

where cols is the many2one field that's pointing out to class in student class.

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 10/2/13, 5:34 AM
Seen: 1366 times
Last updated: 3/16/15, 8:10 AM