From 37c38d8c19dbe2df6d164276c8bcba96024f2f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 29 Nov 2024 12:59:50 +0100 Subject: [PATCH] Ensure current record is None after removing record from the group The removal can trigger __select_changed on the list view which may set the first record of the selection as the current record which may be the deleted record. This prevents the display triggered by record_modified to set the current record in the selection as it has been removed from the group. Closes #13712 (grafted from ed532372fe23eff7fe3e7c94b145bd87c5cf741d) --HG-- branch : 6.0 --- tryton/tryton/gui/window/view_form/screen/screen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tryton/tryton/gui/window/view_form/screen/screen.py b/tryton/tryton/gui/window/view_form/screen/screen.py index 439ddafd8c..7c9c102321 100644 --- a/tryton/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/tryton/gui/window/view_form/screen/screen.py @@ -773,6 +773,9 @@ class Screen(SignalEvent): self.current_record = None record.group.remove(record, remove=remove, signal=False, force_remove=force_remove) + # set current_record to None to prevent __select_changed + # to set deleted record as current_record + self.current_record = None # send record-changed only once record.signal('record-changed')