From 38a0046efb07064d7758f8a9155e0a4c4b106d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 22 Jun 2012 17:51:38 +0200 Subject: [PATCH] Don't reload records when sorting if there are unsaved records issue2664 review403001 (transplanted from 696e37e43e038166ccf84050272397070e54251a) --- tryton/gui/window/view_form/view/list_gtk/parser.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tryton/gui/window/view_form/view/list_gtk/parser.py b/tryton/gui/window/view_form/view/list_gtk/parser.py index b67cd6f30b..a423780cbb 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -64,13 +64,11 @@ def sort_model(column, treeview, screen): store = treeview.get_model() unsaved_records = [x for x in store.group if x.id < 0] search_string = screen.screen_container.get_text() or None - if screen.search_count == len(store): + if screen.search_count == len(store) or unsaved_records: ids = screen.search_filter(search_string=search_string, only_ids=True) store.sort(ids) else: screen.search_filter(search_string=search_string) - for record in unsaved_records: - store.group.append(record) def realized(func):