[FIX] mail: handle js record being created and deleted in same cycle

By luck the situation never happened before, but it is legitimate to handle it.
A future commit will actually introduce the possibility of the issue happening.

closes odoo/odoo#73741

X-original-commit: 62fa7c94724b8144d21ce577aa2f04d5d837c053
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Sébastien Theys
2021-07-14 18:50:05 +00:00
parent 017c335ab2
commit f7d8c40c5d
@@ -664,6 +664,7 @@ export class ModelManager {
// method, and it shouldn't be needed to manually remove
// _toComputeFields, but it is not possible until related are also
// properly unlinked during `set`.
this._createdRecords.delete(record);
this._toComputeFields.delete(record);
this._toCallOnChange.delete(record);
delete Model.__records[record.localId];