From f7d8c40c5d078de898cc8a7563699b477419a5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Wed, 14 Jul 2021 10:36:26 +0000 Subject: [PATCH] [FIX] mail: handle js record being created and deleted in same cycle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/model/model_manager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mail/static/src/model/model_manager.js b/addons/mail/static/src/model/model_manager.js index 9d0f9086607..1e9f0efbeb3 100644 --- a/addons/mail/static/src/model/model_manager.js +++ b/addons/mail/static/src/model/model_manager.js @@ -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];