diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-12-22 12:36:26 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2017-12-22 13:38:30 +0100 |
| commit | c0769c753c4b4d5fa0b5a6a545f5f0141b71e83a (patch) | |
| tree | 6cf8395062250ae51230b19aa45c7e83b43fe7f9 | |
| parent | a1aed05f8dbff935ecefa7d22b210ca38154b9c0 (diff) | |
[FIX] account: prevent traceback
When changing the date of an account move, the method
`_onchange_amount_currency` is called manually on a recordset. If the
recordset length is > 1, it crashes.
| -rw-r--r-- | addons/account/models/account_move.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 1dde4f03844..0257c94eb3f 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -518,7 +518,7 @@ class AccountMoveLine(models.Model): for line in self: 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) + amount = line.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 |
