Comment 5 for bug 782168

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [PS] It is possible to encode product with prices in two different currencies within the same Sales Order

As I commented on the merge proposal, I'm afraid the bug description is not correct, and the alternative suggestions aren't either.
Let me explain. The original bug description is incorrect because it makes no sense to mix different currencies within a single sale order, and we certainly don't want to allow that.
The alternative suggestions using on_change triggers to recompute the amounts are not correct either, for 2 reasons:
- We currently support using multiple pricelists (same currency) during the process of recording a sale order, in case a salesman needs to mix pricelists. Thus when changing pricelists, we do NOT want to alter the already entered prices (not even recompute them), as they really are supposed to be using a different pricelist!
- Now, even if we imagined a selective on_change recompute (one that would recompute prices only if the new pricelist's currency is different), this would be: 1. Hard to implement technically, because on_change triggers can't access the previous value. 2. A very counter-intuitive behavior ; how are users supposed to guess that choosing some pricelists will cause their entire prices to be altered, while some won't do anything?

OpenERP should not handle automatically all exception cases, because there is no safe way of doing that. As you can see, if we decided to enforce one behavior (e.g. automatic recompute), there would be users who would need the opposite behavior, and thus would see the fix as a bug/regression!

I see one possible thing to improve for this use case, however: we could modify the tooltip on the pricelist field to something like:
"The selected pricelist will provide suggested prices for products, and its currency will determine the currency of the sale order.
 If prices from multiple pricelists need to be mixed, select the appropriate pricelist before adding the corresponding products.
Warning: do not mix pricelists with different currencies, as that would likely result in incorrect prices!"

I hope my explanation is clear...