From b4900eda05099a95ae31bd21093c5a38549f7fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 15 Sep 2016 22:23:50 +0200 Subject: [PATCH] Empty value in O2M should remove existing record The changeset 5efdef4c2c7d wrongly skip the removal of existing record in the group. So it was not possible to remove the last record of the field. issue5878 review34271002 --- src/model.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/model.js b/src/model.js index 2547f302f3..3bca9b0461 100644 --- a/src/model.js +++ b/src/model.js @@ -1819,10 +1819,11 @@ var group = record._values[this.name]; var prm = jQuery.when(); if (jQuery.isEmptyObject(value)) { - return prm; + value = []; } var mode; - if (!isNaN(parseInt(value[0], 10))) { + if (jQuery.isEmptyObject(value) || + !isNaN(parseInt(value[0], 10))) { mode = 'list ids'; } else { mode = 'list values';