Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4059 Vizualizări

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

any idea how to do that :)

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
iul. 24
29529
1
dec. 21
5138
3
apr. 18
5988
2
feb. 18
3190
0
iul. 17
3512