Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4984 Zobrazení

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.

Avatar
Zrušit

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

Nejlepší odpověď

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​

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
pro 21
2200
3
bře 24
7165
2
úno 24
2386
4
kvě 20
3465
0
lis 24
9401