Comment 146 for bug 1160365

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote : Re: [Bug 1160365] Re: [7.0] incorrect handling of contact/companies for invoicing and related purposes

Maxime,

As you may know; users should never change the company of a contact
because the contact started to work for another company. The only valid
reason [1] to change the company of a contact is because you fix a
wrongly created record. And, for those that want to handle contacts that
change of companies, we have the base_contact module for this.

Your problem is not related at all with the current discussion. It just
points out a usability issue which is that a user may change the company
of a contact for an invalid reason. Olivier proposed to put a warning to
avoid this mistake for end-users. We don't want to put the field
readonly as you sometimes have to change the company of an existing
contact for a valid reason [1].

Anyway, your scenario gives wrong expectations in v6.1, v7 and Raphaël's
branch.

In v6.1, after modification of Joël from Camptocamp to Akretion, the
invoice has the following fields:
     . Partner: Camptocamp
     . Invoice Address: Joël, Akretion
     . Contact Address: Joël, Akretion
         --> inconsistencies

In Raphael's branch, the invoice has the following fields:
   - Partner: Camptocamp
   - Invoice Address: Joël, Akretion
         --> inconsistencies [2]

In v7:
   - Partner: Joël, Akretion
   - Partner Company: Akretion
         --> consistent, but probably not what the user expect

In these 3 versions, the invoice is sent to Akretion's address. (side
note: In v6.1, as an opposite to the two others, it's sent to Akretion
but with the title 'Camptocamp'.)

As a conclusion;
   - it's normal to have wrong expectations, if you record wrong data.
But, if the change is for a valid reason [1], only v7 is consistent and
correct after the change.
   - v7's data model ensure consistency in the data: it's not possible
to have an invoice for a company whereas the address belongs to another
company
   - Raphaël's branch is totally inconsistent: on the screen you see
"Joël, Akretion", but when you print it, you see "Camptocamp"

[1] Two examples of a valid reason to change the company of the contact;
1/ I record Joël by mistake for the AMCE company and I fix this to ACME
later 2/ I have two customers "Camptocamp" and "Camptocamp SAS" in my DB
and I want to merge these two customers. If you change the company for a
valid reason, v7 does the expect behaviour, not v6.1, not Raphaels branch.

[2] The reason why you probably did not noticed that Raphaël's branch
data are wrong is that it has another bug: printed invoices are always
sent at the company address, not at the invoice address, even if you
define an invoice address. Same for emails, it uses the generic company
email. (try to send an invoice to <email address hidden>, you will probably
never be paid as our leads are forwarded to partners :) So, on the
screen you see "Joël, Akretion", but when you print it, you see
"Camptocamp".

So, in my opinion, your example, even if it's not a valid scenario,
plays largely in favor of v7.

Fabien

On 14/04/13 14:33, Maxime Chambreuil (http://www.savoirfairelinux.com)
wrote:
> @ Fabien
>
> I just updated my odony branch and here is the scenario I tested :
>
> Create Customers with :
> Camptocamp
> Joël
> Akretion
> Raphaël
>
> Create a SO for Joël, confirm it and generate the invoice.
> Group invoices by partner -> CamptoCamp : 1 invoice
>
> Go to Joël and change his company to Akretion.
> Group invoice by partner -> Akretion: 1 invoice
>
> You will tell me that this is normal to you, because your customer is
> Joël not C2C, right ? You want to handle B2C, but this scenario is B2B
> and you can't handle it with your solution.
>
> So, now your turn, download rvalyi's branch and test this scenario, assuming that:
> - if C2C is the customer, I don't change the partner_id field on the SO and the invoice will remain for C2C after Joël's transfer.
> - IfJoël is the customer, you change the partner_id back to Joël on the SO and the invoice will always belong to Joël.
>