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

h all am trying to override create function to give a value for a field to all records that are beuing created so i have written this code but it gives me the error


TypeError: create () missing 1 required positional argument: 'values'
Following is my code

kndly someone help:

@ api.multi 
def create (self, values):
record = super (LibraryBook, self) .create (values)
self.pages = 50
return record

아바타
취소

How to override create function: https://goo.gl/4BkizH

베스트 답변

Hi, 

Change @api.multi to @api.model and try. 

See: How To Override Create Function

Thanks

아바타
취소