From 67e00284e9b69a0334b41585e1c794f73fde8bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 Apr 2010 19:13:35 +0200 Subject: [PATCH] Fix update attributes of separator with field name attributes for issue1544 --- .../gui/window/view_form/view/form_gtk/parser.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/parser.py b/tryton/gui/window/view_form/view/form_gtk/parser.py index 7e0df865b7..eba49a9670 100644 --- a/tryton/gui/window/view_form/view/form_gtk/parser.py +++ b/tryton/gui/window/view_form/view/form_gtk/parser.py @@ -333,14 +333,14 @@ class ParserForm(ParserInterface): fill=int(attrs.get('fill', 0))) elif node.localName == 'separator': text = attrs.get('string', '') - if 'string' in attrs or 'name' in attrs: + if 'name' in attrs: + for attr_name in ('states', 'invisible'): + if attr_name not in attrs and attrs['name'] in fields: + if attr_name in fields[attrs['name']].attrs: + attrs[attr_name] = fields[attrs['name'] + ].attrs[attr_name] if not text: - for attr_name in ('states', 'invisible'): - if attr_name in attrs and attrs['name'] in fields: - if attr_name in fields[attrs['name']].attrs: - attrs[attr_name] = fields[attrs['name'] - ].attrs[attr_name] - text = fields[attrs['name']].attrs['string'] + text = fields[attrs['name']].attrs['string'] vbox = VBox(attrs=attrs) button_list.append(vbox) if text: