Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4470 Vistas

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
Mejor respuesta

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
Publicaciones relacionadas Respuestas Vistas Actividad
3
jul 24
30212
1
dic 21
5724
3
abr 18
6571
2
feb 18
3658
0
jul 17
3943