Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1673 Vizualizări

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
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 25
2750
0
nov. 22
4014
1
mar. 20
5474
2
mar. 15
7782
2
iul. 23
2648