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 6baa1c47ba..357f7f623f 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):