Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5238 Widoki

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


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
wrz 22
1823
1
lip 22
2054
0
lut 23
157
3
sie 22
9188
0
lip 22
2214