Reviewers: ,


Please review this at http://codereview.tryton.org/722002/

Affected files:
  M tryton/gui/window/view_form/view/form_gtk/parser.py


Index: tryton/gui/window/view_form/view/form_gtk/parser.py
===================================================================
--- a/tryton/gui/window/view_form/view/form_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/form_gtk/parser.py
@@ -33,8 +33,12 @@
     def state_set(self, record):
         super(Label, self).state_set(record)
         if not self.attrs.get('string', True) and 'name' in self.attrs:
-            field = record.group.fields[self.attrs['name']]
-            self.set_text(field.get_client(record) or '')
+            if record:
+                field = record.group.fields[self.attrs['name']]
+                text = field.get_client(record) or ''
+            else:
+                text = ''
+            self.set_text(text)


 class VBox(StateMixin, gtk.VBox):


Reply via email to