Rational
It is quite common to have duplicated parties. Even if there are custom checks that tries to avoid such cases, there is no solution that guarantee at 100% that no duplicates will ever exist.
So it is needed to have a way to manage such duplication.
Proposal
A wizard is used to replace all references (Many2One
and Reference
fields) to one party by another one. The replacement must be done at SQL level to avoid to trigger any validation or work-flow but the an history record must be created for historized model.
The wizard should also re-link the addresses and contact mechanism to the new party and mark them inactive.
For other fields like categories, it should create new entries for the missing values.
The replaced party will be marked as inactive to avoid new usage.
The wizard could have some comparison checks that will trigger a warning if both party fields does not match. This will avoid mistakes.
The replacement could be stored in a model to let the party administrator to follow the history.
The reference fields should be explicitly defined, here is a partial list:
- Account Move Line: party
- Invoice: party
- Account Payment: party
- Account Statement: party
- Carrier: party
- Company: party
- Employee: party
- Product Supplier: party
- Project work: party
- Purchase: party
- Sale: party
- Sale Opportunity: party
- Drop Shipment: party
- Shipments: party