Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4046 Представления

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

any idea how to do that :)

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
3
июл. 24
29523
1
дек. 21
5127
3
апр. 18
5986
2
февр. 18
3189
0
июл. 17
3511