Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2003 Tampilan

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mar 25
3113
0
Nov 22
4374
1
Mar 20
5788
2
Mar 15
8076
2
Jul 23
2919