Use the same pattern for move_into than _move to prevent concurrency

(transplanted from f57702fc015c87566146ee11623d8481ff2388c8)
This commit is contained in:
Cédric Krier committed 2012-10-06 17:11:18 +02:00
1 parent e7735c88bd
commit c4aff8dcf2
1 file changed
+4
+4
View File
@@ -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)