Race condition when reload modified record but saved
When a modified record is reloaded with saving, the first validation of the reload (just after the save) can fail if there is a One2Many
field.
This is because the Record.validate
after Record.set
is asynchronous because of the Record._check_load
. So the actual validation can happen after the real reload (via Record.cancel
) is happening. So the record is empty for the validation which could result of a wrong evaluation of inverted domain for example.
I think we should check if fields are loaded synchronously (like in tryton) to avoid having promises that are not waited.