Skip to Content
Menu
This question has been flagged
1 Atsakyti
5176 Rodiniai

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


Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
rugs. 22
1808
1
liep. 22
1996
0
vas. 23
157
3
rugp. 22
9128
0
liep. 22
2195