[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
This commit is contained in:
Nicolas Martinelli
2017-12-22 13:38:30 +01:00
committed by Nicolas Martinelli
parent 45015ea7b7
commit a1aed05f8d
+2 -2
View File
@@ -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