콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5441 화면

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
12929
2
3월 15
7656
0
3월 15
4095
6
5월 24
71230
1
10월 23
2185