summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-05-08 16:12:37 +0200
committerDenis Ledoux <dle@odoo.com>2015-05-08 16:13:03 +0200
commit63db719151b34d3d8b22bbf84607cdda7eb0828d (patch)
treec4a5be2900323af66c05b41b3b1b53d6d2674ef7
parent5b19ae8a5965fa3234725709b946b9bfb6930254 (diff)
[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
-rw-r--r--addons/account/account_bank_statement.py2
1 files changed, 1 insertions, 1 deletions
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: