From 69610c6c1a06e4ebd7e0803eaf6713e488fb784d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 5 Aug 2008 13:58:33 +0200 Subject: [PATCH] Add test for model != None and fix sel_ids_get to get only real ids --- tryton/gui/window/view_form/view/list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index abfe70adf0..7295e18ea1 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -413,7 +413,7 @@ class ViewList(ParserView): and self.widget_tree.editable \ and self.screen.tree_saves \ and previous_model != self.screen.current_model: - if not previous_model.save(): + if previous_model and not previous_model.save(): self.screen.current_model = previous_model self.set_cursor() return True @@ -514,7 +514,7 @@ class ViewList(ParserView): def sel_ids_get(self): def _func_sel_get(store, path, iter, ids): model = store.on_get_iter(path) - if model.id: + if model and model.id > 0: ids.append(model.id) ids = [] sel = self.widget_tree.get_selection()