From 597f723c2822c07ed67f6a2d6a049dcf9f37c9e2 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 20 Aug 2012 14:30:21 +0200 Subject: [PATCH] [FIX] account_voucher: supplier payment, accounting entry generation bzr revid: qdp-launchpad@openerp.com-20120820123021-sombshfgl2bpp2z9 --- 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 5b9726c7fab..f01541b6384 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1081,7 +1081,8 @@ class account_voucher(osv.osv): # otherwise we use the rates of the system (giving the voucher date in the context) amount_currency = currency_obj.compute(cr, uid, company_currency, line.move_line_id.currency_id.id, move_line['debit']-move_line['credit'], context=ctx) if line.amount == line.amount_unreconciled and line.move_line_id.currency_id.id == voucher_currency: - foreign_currency_diff = line.move_line_id.amount_residual_currency + amount_currency + sign = voucher_brw.type in ('payment', 'purchase') and -1 or 1 + foreign_currency_diff = sign * line.move_line_id.amount_residual_currency + amount_currency move_line['amount_currency'] = amount_currency voucher_line = move_line_obj.create(cr, uid, move_line)