From a0b918645a9b0e4b003a57fd159f3564eff6d25e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 1 Jun 2016 13:42:16 +0200 Subject: [PATCH] [FIX] account : _prepare_reconciliation_move_line When computing the amount_currency, the ratio is 1.0 if the difference between amount(computed like this -sum([x.balance for x in move.line_ids])) and the amount set in the statement is not greater than the currency rounding. opw:678588 --- addons/account/models/account_bank_statement.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 1b809fe59a9..04ca1228824 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -711,8 +711,11 @@ class AccountBankStatementLine(models.Model): elif st_line_currency == company_currency: total_amount = self.amount_currency else: - total_amount = statement_currency.with_context({'date': self.date}).compute(self.amount, company_currency) - ratio = total_amount / amount + total_amount = statement_currency.with_context({'date': self.date}).compute(self.amount, company_currency, round=False) + if float_is_zero(total_amount - amount, precision_rounding=company_currency.rounding): + ratio = total_amount / amount + else: + ratio = 1.0 # Then use it to adjust the statement.line field that correspond to the move.line amount_currency if statement_currency != company_currency: amount_currency = self.amount * ratio