コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
5152 ビュー

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
2586
3
3月 24
7578
2
2月 24
2852
4
5月 20
3775
0
11月 24
9748