diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py index 81cfed9cfe..21f63ea7e7 100644 --- a/tryton/gui/window/form.py +++ b/tryton/gui/window/form.py @@ -195,7 +195,7 @@ class Form(SignalEvent): response = win.run() win.destroy() if response == gtk.RESPONSE_OK: - self.screen.display(locale.atoi(entry.get_text())) + self.screen.display(locale.atoi(entry.get_text()), set_cursor=True) def destroy(self): self.screen.signal_unconnect(self) diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index c4d01e62ba..d16f6ebf8d 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -552,7 +552,7 @@ class Screen(SignalEvent): self.current_view.set_cursor() self.request_set() - def display(self, res_id=None): + def display(self, res_id=None, set_cursor=False): if res_id: self.current_model = self.models[res_id] if self.views: @@ -567,6 +567,8 @@ class Screen(SignalEvent): or self.current_model)) self.search_active(self.current_view.view_type \ in ('tree', 'graph', 'calendar')) + if set_cursor: + self.current_view.set_cursor(reset_view=False) def display_next(self): self.current_view.set_value()