[FIX] account: tax line amount

The company currency is USD, the invoice currency is EUR.
- Create an invoice in EUR, set an invoice date
- Compute the taxes (click on "update" button)
- Change the exchange rate between EUR and USD
- Validate the invoice

At validation, the tax amounts are not recomputed. Therefore, they are
still converted in the company currency using the old rate.

Closes #14024
opw-692430
This commit is contained in:
Nicolas Martinelli 2016-11-07 13:22:08 +01:00
parent 369e0bcb45
commit 0a17be70e0
1 changed files with 2 additions and 0 deletions

View File

@ -741,6 +741,8 @@ class account_invoice(models.Model):
line['currency_id'] = currency.id
line['amount_currency'] = currency.round(line['price'])
line['price'] = currency.compute(line['price'], company_currency)
if line.get('tax_amount'):
line['tax_amount'] = currency.compute(line['tax_amount'], company_currency)
else:
line['currency_id'] = False
line['amount_currency'] = False