コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1688 ビュー

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
アバター
破棄
関連投稿 返信 ビュー 活動
1
3月 25
2770
0
11月 22
4038
1
3月 20
5478
2
3月 15
7799
2
7月 23
2653