Odoo Help

Welcome!

This community 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.

7

multiple addresses, emails, phone numbers and companies assigned to a customer

By
Jakub Krzempek
on 10/25/13, 7:25 AM 6,327 views

I'm looking for a possibility to add multiple emails, phone numbers and addresses to one customer/company. I know it is possible by adding another contact in a 'contact' tab, but - honestly - I'd prefer not to, as it creates another contacts in the customer views (which becomes overwhelming eventually). Ideally, the customer view should have a button to add another address/phone/email and store that data in the database. Also, I'd love to assign one persona-partner to multiple company-partner, hence create many2many relationship in res.partner's parent_id. Now it's only a one-way ticket.

I am wondering here if such a module(s) giving these abilities is somewhere around (I had no luck trying to find one... :( ). If not, I imagine that can be achieved by altering the res.parner's table structure. Adding additional fields, like x_phone2, x_email2 etc. seems to be the easiest solution, but I don't know how much e.g. emails I will have to store in the db. Hence my another question: what would be a rule of thumb to transfer the given fields into the arrays, resize them, and accessing if needed? :)

I can provide you with more details if something is unclear or too blurry. ^^

I also have some contacts with a secondary email. If anybody has any hint on how to achieve adding a secondary address, please post it here.

George Rodopoulos
on 8/29/14, 11:58 AM

+1. I don't want to add new people (contacts) to a company, I need to have a default (corporate) address and a remit-to (payable) address.

Jeff Beidler
on 10/1/14, 6:25 PM

+1. I would like to have different addresses, also with different functions, such as domicile address, shop address, office address etc.

Ermin Trevisan
on 10/18/14, 7:40 AM

Like others mentioned above, I am familiar with adding contacts to a company, which didn't seem like a "solution". But Ray Carnes points out of way of using it that so can have "shipping address", "Billing address", etc. See: https://www.odoo.com/forum/help-1/question/how-to-manage-private-persons-customers-with-multiple-addresses-in-openerp-7-40153

john5000
on 11/19/14, 8:59 PM
2

Yenthe

--Yenthe--
6686
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 11/20/14, 2:10 AM

There are a few options here. By default you won't be able to add multiple addresses, emails, phone numbers, .. to a customer but you could add this by code.

One option would be, as you said, to add new fields to the res.partner table and show these fields in the view. The problem here however is that you do not need how many you need and this option is not dynamic.
Your second option, and I believe the best if I understand you correct, is to add a new tab and program a many2many relation in your model. Create a many2many from the table res.partner and then show this new field in the view.
Your code would look something like this..

.py (model) file:

'x_extra_addresses': fields.many2many('res.partner', 'custom_model_name, 'field_name_1', 'field_name2', string="Extra addresses"),

.xml (view) file:

            <page string="Extra addresses">
                <label for="x_extra_addresses" string="Externe personen betrokken bij dit project"/>
                                <field name="x_extra_addresses">
                                    <tree string="yourTreeString">
                                        <field name="street"/>
                    <field name="city"/>
                    <field name="zip"/>
                                    </tree>
                                </field>
                            </page>

Which would give you a new tab that looks something along these lines:


Note: this code should fully work but I did not test this, this is just a sample and you will probably still need to tweak some minor things. It is just a concept, or a possible way.

1
Robert Rübner
On 4/13/16, 8:40 AM

We want to start to create a new module to add the possibility to handle multiple addresses, emails and phones per partner. If you are still interested feel free to participate at https://github.com/blooparksystems/partner/issues/1. Ideas, approaches, solutions are welcome.

1

gunnar

--gunnar--
1153
| 6 7 8
Germany
--gunnar--

born

gunnar
On 3/4/15, 12:38 AM

I think the most elegant way would to write a Module that adds these additional information to res.partner instead of twaeking the base code. Maybe the code posted by Yenthe above could be used for such a Module.

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

6 follower(s)

Stats

Asked: 10/25/13, 7:25 AM
Seen: 6327 times
Last updated: 4/18/16, 11:02 AM