تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1694 أدوات العرض

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
مارس 25
2777
0
نوفمبر 22
4045
1
مارس 20
5488
2
مارس 15
7813
2
يوليو 23
2659