From 63db719151b34d3d8b22bbf84607cdda7eb0828d Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 8 May 2015 16:12:37 +0200 Subject: [PATCH] [FIX] account: Exchanges rates gain/loss during supplier reconciliations This revision is related to dd47b6f5bccfb43ee6fabb81effd16c940a020e0. The above revision was allmost correct, except that, in a supplier invoices, the `amount_currency` of the invoice is negative, and the one of the bank statement is possitive. To check that both are equal, we should subtract one to each other, and check that the diff is 0, but both part need to be the absolute value. opw-634263 closes #6533 --- addons/account/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 4a9c1127410..a6f2c6d6eb0 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -795,7 +795,7 @@ class account_bank_statement_line(osv.osv): #post an account line that use the same currency rate than the counterpart (to balance the account) and post the difference in another line ctx['date'] = mv_line.date if mv_line.currency_id.id == mv_line_dict['currency_id'] \ - and float_is_zero(mv_line.amount_currency - abs(mv_line_dict['amount_currency']), precision_rounding=mv_line.currency_id.rounding): + and float_is_zero(abs(mv_line.amount_currency) - abs(mv_line_dict['amount_currency']), precision_rounding=mv_line.currency_id.rounding): debit_at_old_rate = mv_line.credit credit_at_old_rate = mv_line.debit else: