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)