diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 2d867d26e5..3aeb3b9827 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -1142,7 +1142,7 @@ class ViewTree(View): def set_cursor(self, new=False, reset_view=True): self.treeview.grab_focus() model = self.treeview.get_model() - if self.record and model: + if self.record and model and self.treeview.get_realized(): path = self.record.get_index_path(model.group) if model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY: path = (path[0],)