Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
35665 Переглядів

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

Аватар
Відмінити