Do not send empty x2Many fields when saving

issue8588
review264091002
This commit is contained in:
Nicolas Évrard committed 2019-08-31 01:40:47 +02:00
1 parent b1f15e0538
commit a2dd17ce7e
1 file changed
+5
+5
View File
@@ -893,6 +893,11 @@ class Model(object):
if definition.get('readonly') and definition['type'] != 'one2many':
continue
values[name] = getattr(self, '__%s_value' % name)
# Sending an empty X2Many fields breaks ModelFieldAccess.check
if (definition['type'] in {'one2many', 'many2many'}
and not values[name]):
breakpoint()
del values[name]
return values
@property