Empty value in O2M should remove existing record
The changeset b05bedef260a wrongly skip the removal of existing record in the group. So it was not possible to remove the last record of the field. issue5878 review31521002
This commit is contained in:
1 parent
ea0e436226
commit
d4149a33b9
1 file changed
+3
-3
@@ -583,9 +583,9 @@ class O2MField(Field):
|
||||
def _set_value(self, record, value, default=False):
|
||||
self._set_default_value(record)
|
||||
group = record.value[self.name]
|
||||
if not value:
|
||||
return
|
||||
if isinstance(value[0], (int, long)):
|
||||
if value is None:
|
||||
value = []
|
||||
if not value or isinstance(value[0], (int, long)):
|
||||
mode = 'list ids'
|
||||
else:
|
||||
mode = 'list values'
|
||||
|
||||
Reference in new issue
Block a user