Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4983 Weergaven

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
Annuleer

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

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
dec. 21
2199
3
mrt. 24
7164
2
feb. 24
2385
4
mei 20
3464
0
nov. 24
9401