콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4155 화면

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
29699
1
12월 21
5277
3
4월 18
6153
2
2월 18
3299
0
7월 17
3606