summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>2012-10-10 15:53:59 +0200
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>2012-10-10 15:53:59 +0200
commitcb89d2d842e5e40b4cbbdf17d94f3f7c2041914a (patch)
treec6921c7a2990c2e22c50f1c6fa7ddf27ba907792
parent24c7e25b9bb261752080b564f5fd299365116de6 (diff)
[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
-rw-r--r--addons/account_voucher/account_voucher.py3
1 files changed, 2 insertions, 1 deletions
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 = {