From 6670ee7357611579d2e0fbb3de7fdf093fc7243a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Apr 2011 17:40:12 +0200 Subject: [PATCH] Verify if the added record belong to the tree for issue1979 --- tryton/gui/window/view_form/view/list.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index aafec1662d..3b70c3c502 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -35,7 +35,9 @@ class AdaptModelGroup(gtk.GenericTreeModel): self.__removed = None # XXX dirty hack to allow update of has_child def added(self, group, record): - if group is self.group: + if (group is self.group + and (record.group is self.group + or record.group.child_name == self.children_field)): path = self.on_get_path(record) iter_ = self.get_iter(path) self.row_inserted(path, iter_) @@ -51,7 +53,9 @@ class AdaptModelGroup(gtk.GenericTreeModel): pass def removed(self, group, record): - if group is self.group: + if (group is self.group + and (record.group is self.group + or record.group.child_name == self.children_field)): path = self.on_get_path(record) self.row_deleted(path) if (record.parent and