Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5220 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 9 22
1814
1
thg 7 22
2043
0
thg 2 23
157
3
thg 8 22
9175
0
thg 7 22
2212