From 8e9b3e09710eca666caaeb549f0a333bf4401b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 6 Mar 2012 15:56:45 +0100 Subject: [PATCH] Fix xxx2many WinSearch callback Typo was introduced in changeset 4d0d16477712 --- tryton/gui/window/view_form/view/form_gtk/many2many.py | 9 ++++----- tryton/gui/window/view_form/view/form_gtk/one2many.py | 7 +++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/many2many.py b/tryton/gui/window/view_form/view/form_gtk/many2many.py index 537cb18e98..5048b1435c 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2many.py @@ -141,12 +141,11 @@ class Many2Many(WidgetInterface): return False def callback(result): - res_id = None - if result: - res_id, _ = result[0] self.focus_out = True - self.screen.load(ids, modified=True) - self.screen.display(res_id=res_id) + if result: + ids = [x[0] for x in result] + self.screen.load(ids, modified=True) + self.screen.display(res_id=ids[0]) self.screen.set_cursor() self.wid_text.set_text('') if len(ids) != 1 or not value: diff --git a/tryton/gui/window/view_form/view/form_gtk/one2many.py b/tryton/gui/window/view_form/view/form_gtk/one2many.py index 06b60f63ce..afdffc319d 100644 --- a/tryton/gui/window/view_form/view/form_gtk/one2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/one2many.py @@ -323,11 +323,10 @@ class One2Many(WidgetInterface): return False def callback(result): - res_id = None if result: - res_id, = result[0] - self.screen.load(ids, modified=True) - self.screen.display(res_id=res_id) + ids = [x[0] for x in result] + self.screen.load(ids, modified=True) + self.screen.display(res_id=ids[0]) self.screen.set_cursor() self.wid_text.set_text('') if len(ids) != 1: