From 6bcb3c986830183b84fe378285fbd26eac8e9c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 29 Dec 2022 13:19:01 +0100 Subject: [PATCH] Do not trigger record message if the current record did not changed #11970 --- sao/src/screen.js | 3 +++ tryton/tryton/gui/window/view_form/screen/screen.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sao/src/screen.js b/sao/src/screen.js index 28f513669e..7f60963ac2 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -1280,6 +1280,9 @@ return this.__current_record; }, set current_record(record) { + if (this.__current_record === record) { + return; + } this.__current_record = record; var pos = null; var record_id = null; diff --git a/tryton/tryton/gui/window/view_form/screen/screen.py b/tryton/tryton/gui/window/view_form/screen/screen.py index b5aac259af..010ea4aad4 100644 --- a/tryton/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/tryton/gui/window/view_form/screen/screen.py @@ -70,8 +70,8 @@ class Screen: lambda: collections.defaultdict(lambda: None)) self.tree_states_done = set() self.__group = None - self.new_group(context or {}) self.__current_record = None + self.new_group(context or {}) self.current_record = None self.screen_container = ScreenContainer(attributes.get('tab_domain')) self.screen_container.alternate_view = attributes.get( @@ -486,6 +486,8 @@ class Screen: return self.__current_record def __set_current_record(self, record): + if self.__current_record == record: + return self.__current_record = record if record: try: @@ -501,7 +503,6 @@ class Screen: self.update_resources(record.resources if record else None) # update resources after 1 second GLib.timeout_add(1000, self._update_resources, record) - return True current_record = property(__get_current_record, __set_current_record)