From 0ad0cee2e6fdecbbe0b33fa8e045bfae7b558b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 23 Jun 2008 14:07:43 +0200 Subject: [PATCH] Improve many2many behavior - set focus on the first id that is added in the list - set focus on the entry if record added with keyboard --- tryton/gui/window/view_form/view/form_gtk/many2many.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 84415278df..f528601184 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2many.py @@ -92,7 +92,9 @@ class Many2Many(WidgetInterface): ids = win.run() self.screen.load(ids) - self.screen.display() + self.screen.display(res_id=ids[0]) + if self.screen.current_view: + self.screen.current_view.set_cursor() self.wid_text.set_text('') def _sig_remove(self, *args): @@ -101,6 +103,7 @@ class Many2Many(WidgetInterface): def _sig_activate(self, *args): self._sig_add() + self.wid_text.grab_focus() def _readonly_set(self, value): super(Many2Many, self)._readonly_set(value)