From 1eaf4627843ee40474f72ba0112c70fb552e4f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 18 Apr 2014 19:36:05 +0200 Subject: [PATCH] Fix sorting by account in GeneralLegder For now, sorting on account will sort on the name of the account and not the id. issue3851 review5151002 --- account.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index 81e01677ee..11b39b9e94 100644 --- a/account.py +++ b/account.py @@ -1210,10 +1210,12 @@ class GeneralLedger(Report): clause.append(('move.state', '=', 'posted')) lines = MoveLine.search(clause, order=[ - ('account', 'ASC'), + ('account', 'ASC'), # TODO replace by account.id ('date', 'ASC'), ]) - return groupby(lines, operator.attrgetter('account')) + key = operator.attrgetter('account') + lines.sort(key=key) + return groupby(lines, key) @classmethod def lines(cls, accounts, periods, posted):