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 2ea3a996de..53f29d3d74 100644 --- a/tryton/gui/window/view_form/view/form_gtk/parser.py +++ b/tryton/gui/window/view_form/view/form_gtk/parser.py @@ -67,11 +67,12 @@ class Button(object): self.form.screen.display() def state_set(self, values): - if self.attrs.get('states', False): - if eval(self.attrs.get('states', 'True'), values): - self.widget.show() - else: + state_changes = eval(self.attrs.get('states', {})) + if 'invisible' in state_changes: + if eval(state_changes['invisible'], values): self.widget.hide() + else: + self.widget.show() else: self.widget.show()