From 43be49bbbf330af0b6cabc5626e0be05da409ffc Mon Sep 17 00:00:00 2001 From: fares hantous Date: Tue, 5 Apr 2011 16:48:13 +0100 Subject: [PATCH] remove empty accounts in balance without changing the order for issue1919 --- account.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/account.py b/account.py index f78b9b0b76..6873d17fc7 100644 --- a/account.py +++ b/account.py @@ -1221,7 +1221,11 @@ class GeneralLegder(Report): if not datas['form']['empty_account']: account_id2lines = self.get_lines(account_ids, end_period_ids, datas['form']['posted']) - account_ids = account_id2lines.keys() + set_account_ids = set(account_ids) + set_account_id2lines = set(account_id2lines) + set_account_ids_remove = set_account_id2lines - set_account_ids + for account_id in set_account_ids_remove: + account_ids.remove(account_id) account_id2lines = None account_id2lines = self.lines(account_ids,