diff --git a/tryton/gui/window/view_form/view/form_gtk/reference.py b/tryton/gui/window/view_form/view/form_gtk/reference.py index 7e200259cc..d997f8b013 100644 --- a/tryton/gui/window/view_form/view/form_gtk/reference.py +++ b/tryton/gui/window/view_form/view/form_gtk/reference.py @@ -129,6 +129,9 @@ class Reference(Many2One, SelectionMixin, PopdownMixin): active = i break self.widget_combo.set_active(active) + if active == -1: + # When setting no item GTK doesn't clear the entry + self.widget_combo.child.set_text('') def display(self, record, field): self.update_selection(record, field) diff --git a/tryton/gui/window/view_form/view/form_gtk/selection.py b/tryton/gui/window/view_form/view/form_gtk/selection.py index d9590c0cb5..f97cf25fd7 100644 --- a/tryton/gui/window/view_form/view/form_gtk/selection.py +++ b/tryton/gui/window/view_form/view/form_gtk/selection.py @@ -68,6 +68,8 @@ class Selection(Widget, SelectionMixin, PopdownMixin): self.set_popdown(self.selection, self.entry) if not field: self.entry.set_active(-1) + # When setting no item GTK doesn't clear the entry + self.entry.child.set_text('') return super(Selection, self).display(record, field) value = field.get(record)