Skip to Content
Menú
This question has been flagged
1703 Vistes

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
Descartar
Related Posts Respostes Vistes Activitat
1
de març 25
2784
0
de nov. 22
4051
1
de març 20
5510
2
de març 15
7825
2
de jul. 23
2665