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

Hi everyone.

I have to update everytime one field's value based on another object's field. How to achieve it.Please share ur ideas.Thanks in advance.

아바타
취소
베스트 답변

Yes u can go to create method in that model check condition and update value.

@api.model

def create(self, vals):

    if values[u'key1'] = 'Something':

        values[u'key2'] = 'update value' 

     <remaining code>

아바타
취소
관련 게시물 답글 화면 활동
10
5월 20
8529
1
1월 16
6178
1
1월 25
23040
1
5월 21
5261
5
1월 17
4208