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

Hi Community,

I have one Many2one field is City. and i used it on two places one as a From_City second as a To_City. so i need when i select the city A from From_City. now value is hide into To_City.

How can i do it. if you know please suggest me.

Thanks in Advanced.

아바타
취소

Domain in many2one filed: https://goo.gl/CBP9og

베스트 답변

you can set dynamic domain on to city while change from city

@api.onchange('from_city_id')
def onchange_from_city(self):
res = {
'domain' : {
     'to_city_id' : [('id', '!=', self.from_city_id)],
}
}
return res​

아바타
취소
관련 게시물 답글 화면 활동
1
12월 21
2199
3
3월 24
7164
2
2월 24
2384
4
5월 20
3464
0
11월 24
9401