Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4084 Vues

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

any idea how to do that :)

Avatar
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
3
juil. 24
29574
1
déc. 21
5170
3
avr. 18
6036
2
févr. 18
3214
0
juil. 17
3546