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

I need to fix a bug in a community module. However, calling SUPER will always cause the error to be thrown.

Using osv I can do something like...

osv.osv.write(self, cr, uid, ids, vals, context=context)

This will ignore any other changes to write().


How can we do this using the new API? It's a big method and I don't feel like rewriting it using the old API...

아바타
취소
베스트 답변

Example:

@api.multi    
def unlink(self):
        ...
        return models.Model.unlink(self)


아바타
취소
작성자

I had already tried that but it didn't work. Here's why: one needs to add the "self"...

xpto = models.Model.write(self,vals)

Just as in my example

베스트 답변

HI,

please try models.Model.write(self, vals) if you are using any decorators like @api.multi

아바타
취소
작성자 베스트 답변

I'm not contradicting you, I'm emphasizing why it wasn't working.

Thanks.

아바타
취소
관련 게시물 답글 화면 활동
7
11월 23
8853
1
5월 17
3232
2
3월 19
11080
19
5월 24
96882
3
9월 16
3489