[FIX] account_voucher: complete fixing of vouchers in multi-currency.
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Thu, 2 May 2013 22:59:37 +0000 (00:59 +0200)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Thu, 2 May 2013 22:59:37 +0000 (00:59 +0200)
commit709fc0ca29cce7cf251247f21f063e894e6a0b3f
tree51d8bc2a76601f3a4d97569c1fa1947104276642
parenta7a4f33d0f1a057ca453a616db56a03470cd2e16
[FIX] account_voucher: complete fixing of vouchers in multi-currency.

*uniformized the computation in multi-currency in order to always use res_currency.compute()
*make sure to pass the right conversion rate to _current_rate() function using the context if it is specified on the voucher and, in this function, used the info from the context instead of the computed one if relevant. (This involves an ugly overwriting of the 'rate' field that will disappear in trunk: to stay backward compatible and avoid any update of 'base' module it has to be done this way).
*replace the currency_id field on the voucher by a fields.function (was a fields.related) in order to always have a currency, even if it's a voucher in the company currency. (makes the treatment easier and more consistent. Less error prone)
*misc code reaftoring

bzr revid: qdp-launchpad@openerp.com-20130502225937-ya45q2wvgqy7zo1c
addons/account_voucher/account_voucher.py
addons/account_voucher/test/account_voucher.yml
addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
addons/account_voucher/test/case_eur_usd.yml
addons/account_voucher/voucher_payment_receipt_view.xml