From 46c15d2eff113993e08fdcd151e9e54363ba959b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 3 Sep 2008 14:59:38 +0200 Subject: [PATCH] Test if model exist before calling expr_eval for issue315 --- tryton/gui/window/view_form/view/form_gtk/textbox.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/textbox.py b/tryton/gui/window/view_form/view/form_gtk/textbox.py index 6e898afaad..3bbd63202e 100644 --- a/tryton/gui/window/view_form/view/form_gtk/textbox.py +++ b/tryton/gui/window/view_form/view/form_gtk/textbox.py @@ -52,7 +52,8 @@ class TextBox(WidgetInterface): spell.detach() del spell if not value and self.attrs.get('spell') \ - and CONFIG['client.spellcheck']: + and CONFIG['client.spellcheck'] \ + and self._view and self._view.model: language = self._view.model.expr_eval(self.attrs['spell']) try: spell = gtkspell.Spell(self.textview) @@ -94,7 +95,8 @@ class TextBox(WidgetInterface): spell.detach() del spell - if self.attrs.get('spell') and CONFIG['client.spellcheck']: + if self.attrs.get('spell') and CONFIG['client.spellcheck'] \ + and self._view and self._view.model: language = self._view.model.expr_eval(self.attrs['spell']) try: spell = gtkspell.Spell(self.textview)