Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2593 Näkymät

Hi,

how can i search a specific field (mobile) in res.partner using on_change function 

Avatar
Hylkää
Paras vastaus

Hi Abir,

When you call an onchange function you can access any value from that model through self. For example:

@api.onchange('mobile')
def onchange_phone(self):
    # for example: get the value from the field 'mobile' in a variable named 'mobile'
mobile = self.mobile
# Set a static value on the field 'phone'. You can also use the 'mobile' variable or anything else here. self.phone = '014'

Regards,
Yenthe

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
heinäk. 20
22036
1
maalisk. 19
5528
0
jouluk. 18
13
0
tammik. 17
3126
1
toukok. 16
4737