From 034beccaf2a080fefab96df78245353f5ea648cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Feb 2014 23:56:27 +0100 Subject: [PATCH] Fix selection of column in next/previous When _sign is negative, it doesn't select the first column but the second. So despite of selection the wrong column, it could crash if there is only one column in the view. review3241004 (transplanted from f05cc122d3fd52141386f8097d0fc3989b85abd4) --- tryton/gui/window/view_form/view/list_gtk/editabletree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/list_gtk/editabletree.py b/tryton/gui/window/view_form/view/list_gtk/editabletree.py index 6387636781..602b721300 100644 --- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py +++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py @@ -21,7 +21,7 @@ class TreeView(gtk.TreeView): def next_column(self, path, column=None, _sign=1): columns = self.get_columns() if column is None: - column = columns[-1 * _sign] + column = columns[-1 if _sign > 0 else 0] model = self.get_model() record = model.get_value(model.get_iter(path), 0) if _sign < 0: