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

Hello,

I would like to know if it is possible to create in a given model “X” a Many2many field defined as follows : 

field = fields.Many2many('X', string="description") 

When I'm trying to create this field, I'm getting the following error :

Implicit/canonical naming of many2many relationship table is not possible when source and destination models are the same


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Try by specifying the relation table name along with field defintion.

field = fields.Many2many('model_name', 'relational_table_name', 'column1', 'column2', string="string")

Thanks & Regards

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
سبتمبر 22
1808
1
يوليو 22
1991
0
فبراير 23
157
3
أغسطس 22
9126
0
يوليو 22
2188