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

I am using model.AbstractModel, and there is one relation field that must let comodel_name refers to its self. So it should not be implemented until the class which inherits the abstract class.

It came out of my mind that is any posibility to set a field with @property and raise NotImplementdError in the abstract class, and then implement the field in inherit model like following:

​@property

​def model_id(self):

​return fields.Many2one(comodel_name='sub.class', string='ref')

Just a fancy think, is it posible? Thank you.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
ديسمبر 24
13270
3
يوليو 25
8640
3
مايو 25
1612
1
أبريل 25
1220
3
سبتمبر 24
14074