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

I have a many2one field and I want to add a domain filter to it but I cannot get it to work even though it works as a search filter.


This is how I would like to filter it

[('res_id','=',production_id.id),('res_model','=',production_id._name)]


How can I apply this to a Many2one field?

아바타
취소
베스트 답변

Try this

department_id=fields.Many2one('hr.department','Department',domain="[('company_id','=',campus_id)]")

아바타
취소
작성자

I was sure I had tried that in the XML domain but I didn't think to try it in python with the quotations. Such a simple answer to a big headache but I am glad it worked! Thank you very much

관련 게시물 답글 화면 활동
3
9월 20
72346
1
9월 19
3531
2
9월 23
10105
1
4월 22
2997
0
3월 15
5085