From dd5937abcb0dac187bb96adbe3767fbe1eedca08 Mon Sep 17 00:00:00 2001 From: Ralf Peschke Date: Fri, 29 Mar 2013 08:28:27 +0100 Subject: [PATCH] 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) --- tryton/gui/window/view_form/model/field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py index 1f1aa33e4b..c71faa3aa1 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -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)