From c4aff8dcf295ab98f03c2a49e42384065b3c27c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 6 Oct 2012 17:11:18 +0200 Subject: [PATCH] Use the same pattern for move_into than _move to prevent concurrency (transplanted from f57702fc015c87566146ee11623d8481ff2388c8) --- tryton/gui/window/view_form/view/list.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 285bd6c00a..11a09f56b1 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -126,6 +126,10 @@ class AdaptModelGroup(gtk.GenericTreeModel): group = parent.children_group(self.children_field, check_load=True) if group is not record.group: record.group.remove(record, remove=True, force_remove=True) + # Don't remove record from previous group + # as the new parent will change the parent + # This prevents concurrency conflict + record.group.record_removed.remove(record) group.add(record) record.modified_fields.setdefault(record.parent_name or 'id') group.move(record, 0)