Comment 26 for bug 1155679


Having only 1 field on invoice for contact instead of having 2 fields (one for the contact and one for the company/physical person) can introduce huge problem.

Indeed look at this simple case:

I have 2 company A and B
I have Mr. Dupont as contact in company A
I invoice Mr.Dupont
then Mr.Dupont find a better job in B company so now he works at company B

Then ALL of the invoice of company A is now linked to company B ! (but the move line are correct because the move are linked directly on company B)

The only solution I see to fix this issue is two having 2 fields on a invoice ( contact and partner_id). So if your contact change of company you don't care because the invoice will be still linked to the correct company.

The solution proposed by Raph is good because for simple user you can hide the field partner_id and fill it with a onchange, and for advanced user you can show the field. Also reporting will still be easy because you just have to group by partner_id, and all accounting will work without patching everywhere.

What do you think?

My 2 cents