From c42bf12c091b35a188fe4fee7a17dcb2f8daba39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 27 Feb 2014 12:41:39 +0100 Subject: [PATCH] Fix completion test for Reference field The test must use only the id and should also allow negative id. issue3700 review3691003 --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/many2one.py b/tryton/gui/window/view_form/view/form_gtk/many2one.py index 21f4071601..7459bc4dd1 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -380,7 +380,8 @@ class Many2One(WidgetInterface): return if not self.record: return - if self.field.get(self.record) is not None: + id_ = self.id_from_value(self.field.get(self.record)) + if id_ is not None and id_ >= 0: return model = self.get_model() update_completion(self.wid_text, self.record, self.field, model)