[FIX] account: Exchanges rates gain/loss during supplier reconciliations

This revision is related to dd47b6f5bc.

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
This commit is contained in:
Denis Ledoux 2015-05-08 16:12:37 +02:00
parent 5b19ae8a59
commit 63db719151
1 changed files with 1 additions and 1 deletions

View File

@ -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: