The desired flow of currency rate in expense is as followed:
- (default) Use Odoo currency rate
- Allow the user to set a custom rate (to include fees) when changing
the total amount in company currency
- Revert to the default behaviour when the currency is changed
or the amount in foreign currency is changed
This aims to fix how currency rate is computed and overridden
- Reorganize all currency rate computation, so it doesn't revert to Odoo rate
at every compute call
- Deals with a bug where a "total_amount_currency", when changed
just before calling "action_submit_expenses" would not trigger
the computation of unit_amount
- Force save when changing currency on expense form view to prevent a bug
where the first modification of "total_amount_company" would be canceled
(due to the new behaviour of currency rate computation)
- Removes unit_amount_display from views as it should be removed
in later versions and is deprecated since 16.0
task-3476569
closesodoo/odoo#137598
Signed-off-by: Laurent Smet (las) <las@odoo.com>