changeset 58e384fcce26 in tryton:5.0 details: https://hg.tryton.org/tryton?cmd=changeset&node=58e384fcce26 description: Select the clicked line when activating a button in list view
issue11212 review433141003 (grafted from e97626052a77e58d84dafbe11c32f7ccea4fdfaa) diffstat: tryton/gui/window/view_form/view/list_gtk/widget.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diffs (21 lines): diff -r 26f5b60e9b97 -r 58e384fcce26 tryton/gui/window/view_form/view/list_gtk/widget.py --- a/tryton/gui/window/view_form/view/list_gtk/widget.py Tue Sep 06 23:31:24 2022 +0200 +++ b/tryton/gui/window/view_form/view/list_gtk/widget.py Sat Sep 17 18:58:55 2022 +0200 @@ -1008,11 +1008,17 @@ store = self.view.treeview.get_model() record = store.get_value(store.get_iter(path), 0) + if self.view.record and self.view.record != record: + widget.stop_emission_by_name('clicked') + return True + state_changes = record.expr_eval( self.attrs.get('states', {})) if state_changes.get('invisible') \ or state_changes.get('readonly'): return True + + self.view.treeview.set_cursor(path) widget.handler_block_by_func(self.button_clicked) try: self.view.screen.button(self.attrs)