From 044cfffaf1671f5d5aae2009a57ca19bf9ccaaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 21 Jan 2016 10:31:21 +0100 Subject: [PATCH] Test renderer to disable start_editing on Boolean The focus_column._type can only be 'field', 'button' or 'fill'. It is the renderer that must be tested to disable the start_editing. issue5246 review15921002 --- tryton/gui/window/view_form/view/list_gtk/editabletree.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 470726c247..61f02b07c5 100644 --- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py +++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py @@ -102,8 +102,10 @@ class EditableTreeView(TreeView): def set_cursor(self, path, focus_column=None, start_editing=False): self.grab_focus() - if focus_column and (focus_column._type in ('boolean')): - start_editing = False + if focus_column: + widget = self.view.get_column_widget(focus_column) + if isinstance(widget.renderer, gtk.CellRendererToggle): + start_editing = False self.scroll_to_cell(path, focus_column, use_align=False) super(EditableTreeView, self).set_cursor(path, focus_column, start_editing)