Impacted versions:

At least 8.0

Steps to reproduce:

See https://youtu.be/kmXVzf3ApaM

Current behavior:

Currently if you validate an invoice (even with an invoice date) after the initial conversion rate has changed
(if the rate is changed between creation and validation). The tax amount and the credit/debit amount is not computed from the same rate.

This one is responsible for several production issues for tax reporting for the fiscal administration.

Expected behavior:

The tax amount and the credit/debit amount must be computed from the same rate.

Video/Screenshot link (optional):

https://youtu.be/kmXVzf3ApaM

Related issue : https://github.com/odoo/odoo/issues/13473

My proposal to fix this one : https://github.com/odoo/odoo/pull/13621

raise except_orm(_('Error!'), _("Cannot create the invoice.\nThe related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount. In order to avoid rounding issues, the latest line of your payment term must be of type 'balance'."))
            
            iml += account_invoice_tax.move_line_get(inv.id)
            if inv.type in ('in_invoice', 'in_refund'):
                ref = inv.reference
            else:
                ref = inv.number
            diff_currency = inv.currency_id != company_currency
            
            total, total_currency, iml = inv.with_context(ctx).compute_invoice_totals(company_currency, ref, iml)
            name = inv.supplier_invoice_number or inv.name or '/'
            totlines = []
            if inv.payment_term:
                totlines = inv.with_context(ctx).payment_term.compute(total, date_invoice)[0]
            if totlines:
                res_amount_currency = total_currency
                ctx['date'] = date_invoice
                for i, t in enumerate(totlines):
                    if inv.currency_id != company_currency:
                        amount_currency = company_currency.with_context(ctx).compute(t[1], inv.currency_id)
                    else:
                        amount_currency = False
                    
                    res_amount_currency -= amount_currency or 0
                    if i + 1 == len(totlines):
                        amount_currency += res_amount_currency
                    iml.append({
                        'type': 'dest',
                        'name': name,
                        'price': t[1],