Bug Description

The issue discussed here is what should we do with the 'company' information that we have on the magento addresses.

First, I want to put up some facts and establish a vocabulary to avoid any confusion :

* On Magento, I use the words 'Account' for the main entity (where the e-mail address is registered) and 'Addresses' for the... addresses.
* On OpenERP, I use the word 'Partner' for the main entity which has the 'Is a company flag' and 'Contacts' for the entities which are linked to a 'Partner'.

* In OpenERP, we'll always activate the flag 'Is a company' even if the Magento 'Account' is not a company. 'Is a company' is a misused term to mean that the 'Partner' is allowed to have several 'Addresses'. For Magento customers, we'll ever be able to link several addresses to them as they can in Magento. See the bug lp:1151947 for more information.
* There is no Company field on the Magento 'Accounts', only on the 'Addresses'; we have no mean to know if an 'Account' is a company. The company field on the addresses is a 'char' field.
* Each address in Magento can have its own content.

Actually, this piece of information is just copied to a field 'company' in res.partner.
This field is not printed anywhere in the reports, but could be added in the default address formats (once lp:1193271 has been fixed).

An alternative solution is to bring up the 'company' content from the Magento address to the OpenERP 'partner'.
However, this brings some questions, mainly:
* How do we know from which address we should take the company, mostly when we have different companies between addresses or some address without a company and some with one.
* When we have a different company on several addresses, what should we do with them? They should be displayed on the reports, but if we simply add them in the address frame, we'll probably end up with the partner's company name and the contact's company name displayed.

In Magento I create an account with
A customer X:
- A name and first name (Guewen Baconnier)
- There is no company name field!
An address Y:
- A name and a first name (Guewen Baconnier)
- A company name (Camptocamp)
A second address Z
- A name and a first name (Guewen Baconnier)
- I do not put a company name

In OpenERP we have:
A customer 1:
- A name (Guewen Baconnier)
- To match with the OpenERP data model, this customer is the mix between the customer X and the address Y (name of the address Y is kept)
An address 2:
- A name (Guewen Baconnier)
- This is the address Z in Magento

What you would expect is to have the company name in the name of the customer 1. But what would become the name of the address Y, should it be discarded?

What should happen if the address Y has no company name but address Z has one?

What should happen if I place an order in Magento with a new shipping address because I want it to be delivered to another company.
An address Google
- A name and a first name (Larry Page)
- A company name (Google)

We should be sure that the company name does not update the customer 1 name. What would you expect?

Could it be an option to display 'Company name, Name' in the contacts when a company name is defined? Or to add a 'company' field in the contacts? and to use the company name in customer1 when a company name is defined in the first address (Y)? I'm a bit concerned by the loss of the first name/last name of address Y...

Proposed by David:

This is how I would approach it.

1. There is a Company Name
Create a company with the name of the company. Add the address to the company. Create Customers with the Shipping and Billing addresses if they have them
2. There is no company name and the shipping and billing address match
Create a contact with the the address type of default
3. There is no company and the shipping and billing address do not match
Create the Customer as the company and create a shipping and billing contact as customers associated with the company.

This is a schema with most common use cases and 3 ways to possible ways to handle them.
1. The current one
2. A mix between the current one and the third. Seems not to be a good solution
3. Merge the billing address and the account only it has only 1 address and no company on it, otherwise always keep them separated.

- Accounts are considered as companies if they have a company in the billing address
- Addresses of a company are always imported as contacts of the company
- The name of the company is taken in the company field of the billing address
- The billing address informations (street, city, ...) is copied to the address informations of the company (so it is not empty). Would like your opinion on that.
- The billing address of individuals is merged with the partner
- The other addresses of individuals are imported as additional addresses of the partner.

> The scenario which have been chosen on the schema [0] are:
> B3,C3,D3,E3
>
>
> [0]
> https://i143016638.restricted.launchpadlibrarian.net/143016638/schema_company_name_partner.svg?token=cf08a8ef9a84c8e7a26c34d1edb759c4
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1193281
>
> Title:
> 'Company' field of a Magento address is not used for the name of the
> OpenERP partner
>
> Status in OpenERP Connector:
> Fix Released
>
> Bug description:
> The issue discussed here is what should we do with the 'company'
> information that we have on the magento addresses.
>
> First, I want to put up some facts and establish a vocabulary to avoid
> any confusion :
>
> * On Magento, I use the words 'Account' for the main entity (where the
> e-mail address is registered) and 'Addresses' for the... addresses.
> * On OpenERP, I use the word 'Partner' for the main entity which has the
> 'Is a company flag' and 'Contacts' for the entities which are linked to a
> 'Partner'.
>
> * In OpenERP, we'll always activate the flag 'Is a company' even if the
> Magento 'Account' is not a company. 'Is a company' is a misused term to
> mean that the 'Partner' is allowed to have several 'Addresses'. For Magento
> customers, we'll ever be able to link several addresses to them as they can
> in Magento. See the bug lp:1151947 for more information.
> * There is no Company field on the Magento 'Accounts', only on the
> 'Addresses'; we have no mean to know if an 'Account' is a company. The
> company field on the addresses is a 'char' field.
> * Each address in Magento can have its own content.
>
> Actually, this piece of information is just copied to a field 'company'
> in res.partner.
> This field is not printed anywhere in the reports, but could be added in
> the default address formats (once lp:1193271 has been fixed).
>
> An alternative solution is to bring up the 'company' content from the
> Magento address to the OpenERP 'partner'.
> However, this brings some questions, mainly:
> * How do we know from which address we should take the company, mostly
> when we have different companies between addresses or some address without
> a company and some with one.
> * When we have a different company on several addresses, what should we
> do with them? They should be displayed on the reports, but if we simply add
> them in the address frame, we'll probably end up with the partner's company
> name and the contact's company name displayed.
>
> Copy of the original discussion :
>
>
> --------------------------------------------------->8---------------------------------------------------
>
> Summarizing with an example:
>
> In Magento I create an account with
> A customer X:
> - A name and first name (Guewen Baconnier)
> - There is no company name field!
> An address Y:
> - A name and a first name (Guewen Baconnier)
> - A company name (Camptocamp)
> A second address Z
> - A name and a first name (Guewen Baconnier)
> - I do not put a compa...