Skip to Content
Menu
This question has been flagged
2020 Rodiniai

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
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
kov. 25
3129
0
lapkr. 22
4383
1
kov. 20
5805
2
kov. 15
8104
2
liep. 23
2929