From 0b2fb7bacad5c23efe5fecfddbced20e75975873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 21 Dec 2024 18:12:09 +0100 Subject: [PATCH] Do not select current record if it is no more in the group on_change calls may remove the current record without updating the screen such that it is not possible to compute a selection path. Closes #13770 (grafted from ceb83d197bfcced51643cb723590cd97127eda86) --HG-- branch : 6.0 --- tryton/tryton/gui/window/view_form/view/list.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tryton/tryton/gui/window/view_form/view/list.py b/tryton/tryton/gui/window/view_form/view/list.py index d1d95652d5..4155dfe1fd 100644 --- a/tryton/tryton/gui/window/view_form/view/list.py +++ b/tryton/tryton/gui/window/view_form/view/list.py @@ -1032,6 +1032,10 @@ class ViewTree(View): def display(self, force=False): self.treeview.display_counter += 1 current_record = self.record + if current_record and current_record not in current_record.group: + # current record may have been removed by on_change calls without + # changing the current record of screen before the display + current_record = None if (force or not self.treeview.get_model() or self.group != self.treeview.get_model().group):