Skip to Content
Menu
This question has been flagged
1 Atsakyti
4077 Rodiniai

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

any idea how to do that :)

Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
liep. 24
29566
1
gruod. 21
5167
3
bal. 18
6034
2
vas. 18
3209
0
liep. 17
3541