Commit c730e61e authored by Nicolas Delaby's avatar Nicolas Delaby

Sort tracking_list results by date is useless Resource_zGetTrackingList does it by default.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42691 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f8d313f3
...@@ -50,32 +50,20 @@ ...@@ -50,32 +50,20 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n <value> <string>portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
\n \n
if at_date is None:\n last_affectation_list = context.Item_getAffectationList(**kw)\n
at_date = DateTime()\n
\n
last_affectation_list = portal.portal_simulation.getCurrentTrackingList(\n
item=context.getRelativeUrl())\n
if not last_affectation_list:\n if not last_affectation_list:\n
return None\n return None\n
last_affectation_date_list = [x.getDate() for x in last_affectation_list]\n
last_affectation_date_list.sort()\n
first_affectation_list = portal.portal_simulation.getCurrentTrackingList(\n
item=context.getRelativeUrl(),at_date=last_affectation_date_list[0])\n
\n
if len(last_affectation_list) == 0:\n
return None\n
\n \n
if first_affectation_list[0].node_uid is not None:\n if last_affectation_list[-1].node_uid is not None:\n
site = context.portal_catalog.getObject(first_affectation_list[0].delivery_uid)\n site = portal.portal_catalog.getObject(last_affectation_list[-1].delivery_uid)\n
return site\n return site\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>at_date=None</string> </value> <value> <string>**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
285 286
\ No newline at end of file \ No newline at end of file
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