changeset e97626052a77 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=e97626052a77
description:
Select the clicked line when activating a button in list view
issue11212
review433141003
diffstat:
tryton/gui/window/view_form/view/list_gtk/widget.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (21 lines):
diff -r ee18cb647324 -r e97626052a77
tryton/gui/window/view_form/view/list_gtk/widget.py
--- a/tryton/gui/window/view_form/view/list_gtk/widget.py Fri Sep 16
23:36:30 2022 +0200
+++ b/tryton/gui/window/view_form/view/list_gtk/widget.py Sat Sep 17
18:58:55 2022 +0200
@@ -1305,11 +1305,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)