From bca00202c52cead499efe35614ed00b174c5c528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 24 Jul 2022 23:36:40 +0200 Subject: [PATCH] Do not set cursor on not realized TreeView issue11596 review443421003 (grafted from a999fa1af2f4a523ba9d5610a5fe5fd75bd97526) --HG-- branch : 6.0 --- tryton/gui/window/view_form/view/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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],)