Skip to Content
Menú
This question has been flagged
1 Respondre
4057 Vistes

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

any idea how to do that :)

Avatar
Descartar
Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
3
de jul. 24
29529
1
de des. 21
5134
3
d’abr. 18
5986
2
de febr. 18
3190
0
de jul. 17
3511