Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5294 มุมมอง

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
5
ก.ย. 20
12820
2
มี.ค. 15
7502
0
มี.ค. 15
3972
6
พ.ค. 24
70988
1
ต.ค. 23
2128