diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 75f39862d2..2a4fb84eb3 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -1151,8 +1151,8 @@ class ViewTree(View): def set_cursor(self, new=False, reset_view=True): self.treeview.grab_focus() - if self.screen.current_record: - model = self.treeview.get_model() + model = self.treeview.get_model() + if self.screen.current_record and model: path = model.on_get_path(self.screen.current_record) if model.get_flags() & gtk.TREE_MODEL_LIST_ONLY: path = (path[0],)