İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4353 Görünümler

i want to preform some function when  when the selection happen to change value in other module 

any idea how to do that :)

Avatar
Vazgeç
En İyi Yanıt

Hi Ahmad,

You can add a onchange function for the selection field in the first model, let it be model A, then inside the the onchange function you can access the other model, let it be model B and can change the record accordingly.

@api.onchange('test_field')
def test_function(self):
model_b_rec = self.env['model_b']
new_employee = model_b_rec.create({
'name': self.name,
})

Thanks

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Tem 24
29997
1
Ara 21
5549
3
Nis 18
6429
2
Şub 18
3478
0
Tem 17
3814