跳至内容
菜单
此问题已终结
1 回复
5112 查看

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

形象
丢弃
编写者 最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
5
9月 20
12652
2
3月 15
7294
0
3月 15
3810
6
5月 24
70700
1
10月 23
1995