Use stored value for One2Many changed without initial value
If the client does not send the value for the One2Many (it happens when it is not modified), we must assume that it has the stored value unchanged. Otherwise the current records are considered as to be added but with only their changed values. issue8605 review265901016
This commit is contained in:
1 parent
dd1626e5cf
commit
d2bc591d18
1 file changed
+1
-1
@@ -775,7 +775,7 @@ class ModelView(Model):
|
||||
value = value.id
|
||||
elif field._type == 'one2many':
|
||||
targets = value
|
||||
init_targets = list(init_values.get(fname, []))
|
||||
init_targets = list(init_values.get(fname, targets))
|
||||
value = collections.defaultdict(list)
|
||||
value['remove'] = [t.id for t in init_targets if t.id]
|
||||
for i, target in enumerate(targets):
|
||||
|
||||
Reference in new issue
Block a user