[FIX] account_voucher: validation of refund in multicurrency
authorMartin Trigaux <mat@openerp.com>
Wed, 6 Aug 2014 12:51:48 +0000 (14:51 +0200)
committerMartin Trigaux <mat@openerp.com>
Wed, 6 Aug 2014 14:45:00 +0000 (16:45 +0200)
commit02f0caf1b8adf3a56931dc4e5feb0f9abc32e0df
tree22954d39a24b3bd613114c49f0da609f5b8f2710
parentd909f763b8d6c57c23f71b14e66fbb3e8fe79044
[FIX] account_voucher: validation of refund in multicurrency

Fixing several issues for refunds in multicurrency mode that prevented the moves to be balanced.
The amount_currency needs to use the absolute value, as a refund will have a negative amount.
The sign for currency_rate_difference needs to use the line instead of the voucher as they can have different value. e.g. a voucher of 1000$ with invoice of 1200$ and refund of 200$ will have two lines and their currency_rate_difference should have different signs.
Avoids doubling the value in foreign_currency_diff
Fixes #1490, opw 607118 & 611580
addons/account_voucher/account_voucher.py