From 43dd05fffd9fbd78cb5f6c5f90e4b4c02380eccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 5 May 2010 22:57:19 +0200 Subject: [PATCH] Append unsaved records after sort As sort is done on server side, unsaved records are lost Now they are appended at the end of the list --- tryton/gui/window/view_form/view/list_gtk/parser.py | 3 +++ 1 file changed, 3 insertions(+) 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 e17a1048da..3334a67936 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -55,11 +55,14 @@ def sort_model(column, treeview, screen): column.arrow_show = False column.arrow.hide() store = treeview.get_model() + unsaved_records = [x for x in store.group if x.id < 0] if screen.search_count == len(store): ids = screen.search_filter(only_ids=True) store.sort(ids) else: screen.search_filter() + for record in unsaved_records: + store.group.append(record) class ParserTree(ParserInterface):