Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4062 Lượt xem

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

any idea how to do that :)

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 24
29531
1
thg 12 21
5138
3
thg 4 18
5992
2
thg 2 18
3191
0
thg 7 17
3512