Se rendre au contenu
Menu
Cette question a été signalée
1702 Vues

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
Avatar
Ignorer
Publications associées Réponses Vues Activité
1
mars 25
2784
0
nov. 22
4051
1
mars 20
5509
2
mars 15
7824
2
juil. 23
2665