Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
5289 Näkymät

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

Avatar
Hylkää
Tekijä Paras vastaus

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.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
5
syysk. 20
12817
2
maalisk. 15
7496
0
maalisk. 15
3971
6
toukok. 24
70980
1
lokak. 23
2124