From f1ab6513b3e41c0cc08e5d7c20a7fc749e9c3ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 29 Oct 2023 13:49:30 +0100 Subject: [PATCH] Iterate over removed and deleted records when adding record to group In Javascript for...in iterate over properties but we want to iterate over values with for...of. Otherwise record added back is not un-removed or un-deleted. Closes #12663 --- sao/src/model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sao/src/model.js b/sao/src/model.js index 0808dd52c2..590034770c 100644 --- a/sao/src/model.js +++ b/sao/src/model.js @@ -142,13 +142,13 @@ if (this.indexOf(record) < 0) { this.splice(position, 0, record); } - for (var record_rm in this.record_removed) { + for (var record_rm of this.record_removed) { if (record_rm.id == record.id) { this.record_removed.splice( this.record_removed.indexOf(record_rm), 1); } } - for (var record_del in this.record_deleted) { + for (var record_del of this.record_deleted) { if (record_del.id == record.id) { this.record_deleted.splice( this.record_deleted.indexOf(record_del), 1);