[FIX] account: fallback on the currency_rate when calculating the rate
Steps to reproduce:
- In Accounting create a new tax like this:
-Tax computation: percentage of price tax included
-Amount: 100%
-Included in Price: Ticked
- Create a new Customer Invoice in another currency
- Use the 100% tax
- Go in the tab "Journal Entries"
- The amounts where not converted
Cause:
The rate is calculated like this : `rate = line.amount_currency / line.balance if line.balance else 1`
But with this specific tax `amount_currency` and `balance` are 0 so the rate defaults to 1 thus not converting.
Solution:
Fallback on the rate of the line.
opw-4443522
closes odoo/odoo#193593
Signed-off-by: Mathieu Coutant (mcou) <[email protected]>