Odoo Help

1 Answer
4/5/19, 6:19 AM

If you don't specify the relation table when define Many2many field odoo will create a new table name "test_model_product_template_rel" as relation table between "test.model" and "product.template", which mean your "m2m_1" and "m2m_2" are using the same relation table, if you want to separate them then you need to add "relation" option when m2m_2 is defined such as:

m2m_2 =fields.Many2many(comodel_name="product.template", relation="test_model_product_template_rel_2", column1="test_id", column2="product_tmpl_id")

and the "self" will be product.template
Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now