summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2017-12-22 12:14:22 +0100
committerNicolas Martinelli <nim-odoo@users.noreply.github.com>2017-12-22 13:38:30 +0100
commita1aed05f8dbff935ecefa7d22b210ca38154b9c0 (patch)
tree6d82ef0d0f8847fd300aef3f291aa6bdb714e565
parent45015ea7b74939c8e127595bcc840ee68a506c2d (diff)
[FIX] account: change currency in move line
- In an account move, change the date - All debits and credits of the lines are reset This is because the recomputation of the credits and debits should only occur in case of currency rate change. opw-801030
-rw-r--r--addons/account/models/account_move.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 9ce29acd016..1dde4f03844 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -519,8 +519,8 @@ class AccountMoveLine(models.Model):
amount = line.amount_currency
if line.currency_id and line.currency_id != line.company_currency_id:
amount = self.currency_id.with_context(date=line.date).compute(amount, line.company_currency_id)
- line.debit = amount > 0 and amount or 0.0
- line.credit = amount < 0 and -amount or 0.0
+ line.debit = amount > 0 and amount or 0.0
+ line.credit = amount < 0 and -amount or 0.0
####################################################
# Reconciliation interface methods