From cb89d2d842e5e40b4cbbdf17d94f3f7c2041914a Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 10 Oct 2012 15:53:59 +0200 Subject: [PATCH] [FIX] account_voucher: wrong accounting entry for supplier payment in foreign currency lp bug: https://launchpad.net/bugs/1007487 fixed bzr revid: qdp-launchpad@openerp.com-20121010135359-0h0cxeyvk8lrtzni --- addons/account_voucher/account_voucher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 = {