This question has been flagged
1 Reply
7157 Views

To my knowledge you can create a company as a customer and put another customer under it, for example as a contact holder.

But is it possible to put a company under another company?

Avatar
Discard

I think that this question is a duplicate of how-do-we-set-a-hierarchy-for-partners/

Best Answer

Yes, it is possible!

On v6.x, it was possible to define a "parent partner" on the partner form view in the tab "Sales and Purchases". Technically, this field was called parent_id

On v7, this field is not there anymore, at least by default. With the developer mode, I looked at the fields available for the object Customer (res.partner) and parent_id is still there in the DB. So basically, you can make this field visible on the form view in v7 (with the view editor for example). I tested on runbot and it works. (For some reason, its default label is "Related Company" but you can change that to "Parent Company" if you want).

The result is that you can see companies within companies on the same level than their contacts. Here are some screenshots where Vicking Direct is the parent of Agrolait:

image description

 

image description

 

Avatar
Discard
Author

What Code did you use to make it appear?

As I understood it, he edited the XML view from the view edition tools in OpenERP. However, I don't think it's a good idea to have related company in contacts tabs. As explained in my answer to my own question, I created a module for that:

how-do-we-set-a-hierarchy-for-partners

Author

Ahh found the code part it works!

Yes, as Yannick said, I just edited the view from the view editor.

Downvoted: as a partner, I certainly don't want to edit the view through the web in order to work around a regression for all customer installation I have to perform. The answer proposed in http://help.openerp.com/question/120/how-do-we-set-a-hierarchy-for-partners/ is much more suitable in this regard.