Commit c7e90a27 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

business paths should be sorted by int_index.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32153 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 28ebe7a5
......@@ -86,10 +86,12 @@ class BusinessProcess(Path, XMLObject):
elif not isinstance(trade_phase, (list, tuple)):
trade_phase = (trade_phase,)
result = []
business_path_list = sorted(self.objectValues(portal_type="Business Path"),
key=lambda x:x.getIntIndex())
if len(trade_phase) == 0:
return self.objectValues(portal_type="Business Path")
return business_path_list
trade_phase = set(trade_phase)
for document in self.objectValues(portal_type="Business Path"):
for document in business_path_list:
if trade_phase.intersection(document.getTradePhaseList()):
result.append(document)
return result
......
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