Use parent company contact as billing address/contact?

Hello,

we have defined parent/children companies and contacts.
When we now do sales orders/deliveries and invoices, then we can select a parent contact to be used as the invoice address on an individual document.
This works fine with MAIN_USE_COMPANY_NAME_OF_CONTACT set to 1

But we still have to select/assign the correct parent contact on the document manually.
Is there a way to have Dolibarr selecting/using a specific parent contact for the invoices? (And perhaps also as delivery contact etc. for the other parts of Dolibarr)

The most “logic” way for me, would be that I could also select parent contacts as the default invoice/shipping/crm contacts, and not only contacts of the child third party.

Or perhaps we are looking at it the wrong way?

I really like your idea!
We would like to do the same thing

I did implent this behavious for the invoice contact as a module.
If you are interested, I can send you a copy.
Not yet sure if it will be opensource in the future or if it will be placed in dolistore

That would be great.
I might want to extend it for “all” types of contacts. If I do I will send you the changes if you like.

If you have a repo on github you can add me as cfoellmann. You can also find my mail address there cfoellmann (Christian Foellmann) (github.com)

I added you to the github project
Feedback/updates welcome.

We could enhance this to be allowed to be defined per document type and also which contacts to takes over.
Also an option would be to keep existing contacts, or just replace them or add them only if none of this type exists

But I think we do this based on needs and not to cover all cases which might perhaps never be needed