Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4207 Zobrazení

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

any idea how to do that :)

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvc 24
29732
1
pro 21
5324
3
dub 18
6204
2
úno 18
3325
0
čvc 17
3662