From a184184b968b5483b1db9124023de4c8bbf6bedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 3 Apr 2010 14:26:46 +0200 Subject: [PATCH] Test if widget_tree is on current_view before using it as color widget of Many2Many for issue1481 --- tryton/gui/window/view_form/view/form_gtk/many2many.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/many2many.py b/tryton/gui/window/view_form/view/form_gtk/many2many.py index aefa3bb9a2..84c0a6183a 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2many.py @@ -70,7 +70,9 @@ class Many2Many(WidgetInterface): self.wid_text.connect('key_press_event', self.on_keypress) def _color_widget(self): - return self.screen.current_view.widget_tree + if hasattr(self.screen.current_view, 'widget_tree'): + return self.screen.current_view.widget_tree + return super(Many2Many, self)._color_widget() def grab_focus(self): return self.wid_text.grab_focus()