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

Hello, 

Can you explain me this Python function ? 

    @api.model
    def create(self, vals):
        record = super(ResPartnerSchool, self).create(vals)
        record.no_duplicate_school_dates()
        if not self.env.context.get('tracking_disable'):
            record.changed_half_pension()
        return record

and specially :

        if not self.env.context.get('tracking_disable'):
            record.changed_half_pension()

Thanks you

아바타
취소
베스트 답변

if not self.env.context.get('tracking_disable') this means if context does not have
"tracking_disable" or {'tracking_disable': False}

아바타
취소
베스트 답변

hello,

if not self.env.context.get('tracking_disable'):   
record.changed_half_pension()
this context you will get at the time when you import the csv file into odoo. so whenver you  
upload the csv file data to the system at that time the create method is call. so when you didn't
get the context at that time record.changed_half_pension() method will call. and when you import the
data from import button at that time record.changed_half_pension() this method will not call.

아바타
취소
관련 게시물 답글 화면 활동
2
8월 25
2495
3
2월 25
3797
0
5월 24
46
1
4월 24
3512
4
9월 23
5050