Comment 202 for bug 1160365

Revision history for this message
Michael Telahun Makonnen (mmakonnen) wrote :

In replyt #156 @fabien said:
"John Doe, Acme" is a first-class object, not "John Doe". If you want to
manage "John Doe" as a person, you need base_contact module (it's not
related to our solution, it's the same in v6.1 and in raphael's
proposition too)."

Apologies if this might be a slight digression, but I can't let this comment just pass by without responding.

I will say this again: this is the result of a broken data model. There is no reason, technical or otherwise, for this behavior. There is no such thing as "John Doe, Acme". There is only John Doe, who at a particular moment in time works for Acme, and at another time works for XYZ Widgets, and then later on starts his own business. This is the real-world model that OpenERP should be modeling, and this is the model that is most intuitive to any normal user.

While I have not made a very deep analysis, I suspect that you could avoid this "John Doe, Acme" business if you stored both the relation to res.partner *and* also copied the current address of the partner to the invoice. So instead of just partner_id, you would also have a couple of text fields for address and email. This would completely avoid the need to get the address from the res.partner object every time you accessed it. Then, it doesn't matter if John Doe changes jobs or whatever because the address, and any other pertinent temporary data you need, is stored in the invoice itself. And if you think about it, this makes a lot of sense because you only need John Doe's address at the time that you create and send the invoice. Whether you look at the invoice again tomorrow or next week or ten years from now you are only interested in John Doe's address at the time that you invoiced him/his company. Said another way: if you are looking at an invoice from 10 years ago you are only interested seeing John Doe's address at the time that you invoiced him, not his current address. The following scenario would work out of the box with just one John Doe record in res.partner:
1. Invoice John Doe @ Acme, Inc
2. Invoice John Doe @ XYZ Widget, Inc
3. Invoice John Doe @ John Doe, Inc.