Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4994 Ansichten

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
Verwerfen

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

Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Dez. 21
2207
3
März 24
7170
2
Feb. 24
2390
4
Mai 20
3466
0
Nov. 24
9401