Odoo Help


Add record to Many2many field from Many2one field

on 3/29/16, 9:45 PM 541 views

I have a module with:

parent_id = fields.Many2one('res.partner')
parent_child_ids = fields.Many2many(comodel_name='res.partner',

What I expect:

I added the parent_id in the partner form where in the user can customer's parent. What I want to achieve is, when I select a parent company for a particular customer - the customer will be automatically added to child_ids of the parent company (override create and write method). And when I select child_ids in the parent company, the customer's parent id field will be updated to parent company id. How to achieve that?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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

Question tools

1 follower(s)


Asked: 3/29/16, 9:45 PM
Seen: 541 times
Last updated: 3/30/16, 12:53 AM