[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
This commit is contained in:
Goffin Simon
2016-06-02 09:40:01 +02:00
parent 011ce1e83a
commit a0b918645a
@@ -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