Commit d1a19387 authored by Romain Bignon's avatar Romain Bignon
Browse files

fix sort of transactions

It now sorts transactions on each page instead of doing it globally
parent 18c1f469
......@@ -62,5 +62,4 @@ def iter_history(self, account):
post = {'task': 'Synthese', 'process': 'SyntheseCompte', 'taskid':'Releve'}
return sorted(, key=lambda tr: tr.rdate, reverse=True)
......@@ -120,7 +120,19 @@ class OperationsPage(LoggedPage, HTMLPage):
class iter_transactions(ListElement):
item_xpath = '//div[@id = "releve-reserve-credit"]//table/tbody/tr'
item_xpath = '//table[@class="tableau-releve"]/tbody/tr[not(node()//span[@class="solde-initial"])]'
flush_at_end = True
def flush(self):
# As transactions are unordered on the page, we flush only at end
# the sorted list of them.
return sorted(self.objects.itervalues(), key=lambda tr: tr.rdate, reverse=True)
def store(self, obj):
# It stores only objects with an ID. To be sure it works, use the
# uid of transaction as object ID. = obj.unique_id(seen=self.env['seen'])
return, obj)
class credit(ItemElement):
klass = Transaction
......@@ -150,5 +162,3 @@ def next_page(self):
if options:
data = {'numReleve':options[0].values(),'task':'Releve','process':'Releve','eventid':'select','taskid':'','hrefid':'','hrefext':''}
return requests.Request("POST",, data=data)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment