[IMP] account: Improve fixes https://github.com/odoo/odoo/commit/ab1ae1a854eab4a38aa2866bfc9d8ca9aa4013be
[IMP] account: Improve fixes https://github.com/odoo/odoo/commit/ab1ae1a854eab4a38aa2866bfc9d8ca9aa4013be

Explanation about flushing in action_switch_invoice_into_refund_credit_note:
Because the 'type' is set before 'amount_total', 'amount_total' is recomputed with the
wrong type and then make the condition badly evaluated.
For some reason, the field wasn't badly recomputed before:
https://github.com/odoo/odoo/commit/020e2a5e85036976b309b439582d70b5b775e54f

closes odoo/odoo#44868

X-original-commit: a82e62d1925ebfd4f49360fdc5f3a8d28de5a0d9
Signed-off-by: oco-odoo <15533318955789ab09e4c2224ebf367eff32f177@users.noreply.github.com>

ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo