From ddd2a3e97c4c7dea1273a1b97f55b0d1ce3dbdef Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 23 Sep 2015 21:21:49 +0200 Subject: [PATCH] [FIX] account: prepare_move_lines_for_reconciliation_widget In the case where target_currency == company_currency, the actual_debit or the actual_credit must be equal to the amount_residual defined on the account.move.line and expressed in the currency of the company. The actual_debit/actual_credit must take into account the possible partial reconciliations and this is done by the residual amount. opw:648744 --- addons/account/account_move_line.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index cd744fce26d..b5ee20e2a9f 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -836,9 +836,9 @@ class account_move_line(osv.osv): ret_line['credit_currency'] = actual_credit ret_line['debit_currency'] = actual_debit if target_currency == company_currency: - actual_debit = debit - actual_credit = credit - total_amount = debit or credit + actual_debit = debit > 0 and amount or 0.0 + actual_credit = credit > 0 and amount or 0.0 + total_amount = abs(debit - credit) else: ctx = context.copy() ctx.update({'date': line.date})