diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 423026251c2..f97f3f6af3c 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1070,7 +1070,8 @@ class account_voucher(osv.osv): if line.amount == line.amount_unreconciled: if not line.move_line_id.amount_residual: raise osv.except_osv(_('Wrong bank statement line'),_("You have to delete the bank statement line which the payment was reconciled to manually. Please check the payment of the partner %s by the amount of %s.")%(line.voucher_id.partner_id.name, line.voucher_id.amount)) - currency_rate_difference = line.move_line_id.amount_residual - amount + sign = voucher_brw.type in ('payment', 'purchase') and -1 or 1 + currency_rate_difference = sign * (line.move_line_id.amount_residual - amount) else: currency_rate_difference = 0.0 move_line = {