Since this commit, https://github.com/odoo/odoo/commit/32ada4a415a14052d780f351edb82a0011561451,
when adding a new rate from the tree view,
if the `name` field is emptied (despite having a default value),
the `_onchange_rate_warning()` method will generate a traceback
because it will call `_get_latest_rate()` that relies on the `name`
field to order the company rates.
Steps to reproduce:
- Go to the Accounting App.
- Click on Configuration > Currencies.
- Select any currency and click on "Add a line" in the Rates tab.
- Remove the default value from the "Date" field and leave it empty.
- Now try to change "Unit per USD". A traceback should be triggered.
New behavior:
With this fix, an error message will now invite the user to set the `name`
(a.k.a. 'Date') correctly.
closesodoo/odoo#100874
X-original-commit: ddced61ca27f96b89af32f0b99e225321f966681
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>