Commit 130b1ac5 authored by Jérome Perrin's avatar Jérome Perrin

ERP5; work around sort on creation date precision in Alarm.getLastActiveProcess

parent dea9c839
......@@ -345,11 +345,11 @@ Alarm Tool Node: %s
limit = 1
else:
limit = self.isActive() and 2 or 1
active_process_list = self.getPortalObject().portal_catalog(
portal_type='Active Process', limit=limit,
sort_on=(('creation_date', 'DESC'),
('id', 'DESC', 'UNSIGNED'),),
causality_uid=self.getUid())
active_process_list = sorted(self.getPortalObject().portal_catalog(
portal_type='Active Process',
sort_on=(('creation_date', 'DESC'), ),
causality_uid=self.getUid(),
limit=5,), key=lambda x:x.getCreationDate(),)[-limit:]
if len(active_process_list) < limit:
process = None
else:
......
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