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
This commit is contained in:
Cédric Krier
2014-04-18 19:36:05 +02:00
parent 4f95688112
commit 1eaf462784
+4 -2
View File
@@ -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):