Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4331 Visualizzazioni

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

any idea how to do that :)

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
lug 24
29957
1
dic 21
5522
3
apr 18
6393
2
feb 18
3450
0
lug 17
3776