Prevent o2m-records to be deleted on client-side
When I delete some records of an one2many-field in an on-change-Event, the deleted records are sent to the client and the client hides them in the list. Pressing the save button the record loads again including the deleted o2m-records. The reason is the force_remove-flag. This will delete the record on the client-side and therefore this change will not be reflected on the server side. issue3091 review744002 (transplanted from e40190b28b312f3dd63bceb167698a885826ea0e)
This commit is contained in:
1 parent
ad5090570c
commit
dd5937abcb
1 file changed
+1
-1
@@ -699,7 +699,7 @@ class O2MField(CharField):
|
||||
to_remove.append(record2)
|
||||
for record2 in to_remove:
|
||||
record.value[self.name].remove(record2, signal=False,
|
||||
force_remove=True)
|
||||
force_remove=False)
|
||||
|
||||
if value and (value.get('add') or value.get('update', [])):
|
||||
record.value[self.name].add_fields(fields, signal=False)
|
||||
|
||||
Reference in new issue
Block a user