跳至内容
菜单
此问题已终结
1 回复
4066 查看

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

形象
丢弃
相关帖文 回复 查看 活动
3
7月 24
29540
1
12月 21
5148
3
4月 18
6005
2
2月 18
3197
0
7月 17
3520