Commit 17a597b9 authored by Fabien Morin's avatar Fabien Morin

version is now catalogued and cmp is performance killer so use sorting from the catalog.

Thanks to Kazuhico for his review


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27794 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2fca2403
......@@ -357,12 +357,8 @@ class TradeCondition(Path, Transformation, XMLMatrix):
effective_model_list = []
model_object_list = [result.getObject() for result in \
self.portal_catalog(portal_type=self.portal_type,
reference=reference,)]
#sort_on=(('version','descending'),))]
# XXX currently, version is not catalogued, so sort using python
def sortByVersion(a, b):
return cmp(b.getVersion(), a.getVersion())
model_object_list.sort(sortByVersion)
reference=reference,
sort_on=(('version','descending'),))]
# if there is model which has effective period containing
# the start_date and the stop date of the paysheet, return it
......
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