跳至內容
選單
此問題已被標幟
1 回覆
5263 瀏覽次數

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
9月 22
1836
1
7月 22
2082
0
2月 23
157
3
8月 22
9216
0
7月 22
2237