Skip to Content
मेन्यू
This question has been flagged
1672 Views

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
Discard
Related Posts Replies Views Activity
1
मार्च 25
2743
0
नव॰ 22
4012
1
मार्च 20
5473
2
मार्च 15
7776
2
जुल॰ 23
2646