Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1686 Widoki

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
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
mar 25
2770
0
lis 22
4037
1
mar 20
5478
2
mar 15
7798
2
lip 23
2653