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

Hi, I am wondering if it's good practice to override the method create, on a model and update a field in the following way (using object.attribute = value):


Class MyTable:

​starting_date: fields.Datetime(string='any date')
​**** MORE FIELDS ******

​@api.model
​def create(self, values):
​***** SOME LOGIC HERE ******
​new_record = super(MyTable, self).create(values)
​new_record.starting_date = new_record.create_date
​return new_record
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 25
2873
0
лист. 22
4127
1
бер. 20
5553
2
бер. 15
7855
2
лип. 23
2714