changeset a999fa1af2f4 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=a999fa1af2f4
description:
        Do not set cursor on not realized TreeView

        issue11596
        review443421003
diffstat:

 tryton/gui/window/view_form/view/list.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 4bb055fdffb4 -r a999fa1af2f4 tryton/gui/window/view_form/view/list.py
--- a/tryton/gui/window/view_form/view/list.py  Sun Jul 24 23:35:45 2022 +0200
+++ b/tryton/gui/window/view_form/view/list.py  Sun Jul 24 23:36:40 2022 +0200
@@ -1213,7 +1213,7 @@
     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],)

Reply via email to