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)