From 0ffdb081ff4089f226ee31b3ecfc51690e8d9416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 14 Apr 2013 00:26:55 +0200 Subject: [PATCH] select first record only if nothing is selected Otherwise the first record is always appended to the selection when a focus event happens review779003 --- tryton/gui/window/view_form/view/list_gtk/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/list_gtk/parser.py b/tryton/gui/window/view_form/view/list_gtk/parser.py index 4a560f3acf..eb6d60d0ce 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -298,7 +298,7 @@ class ParserTree(ParserInterface): def set_selection(self, treeview, direction): selection = treeview.get_selection() - if len(treeview.get_model()): + if len(treeview.get_model()) and not selection.count_selected_rows(): selection.select_path(0) return False