Commit 2f0b824f authored by Nicolas Delaby's avatar Nicolas Delaby

Fallback on getFutureTrackingList of not available in current tracking

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42425 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8237d0fe
......@@ -50,19 +50,22 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n
<value> <string>portal = context.getPortalObject()\n
\n
if at_date is None:\n
at_date = DateTime()\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(\n
last_affectation_list = portal.portal_simulation.getCurrentTrackingList(\n
item=context.getRelativeUrl(), at_date=at_date)\n
\n
if len(last_affectation_list) == 0:\n
if not last_affectation_list:\n
last_affectation_list = portal.portal_simulation.getFutureTrackingList(\n
item=context.getRelativeUrl())\n
if not last_affectation_list:\n
return None\n
\n
if last_affectation_list[0].node_uid is not None:\n
site = context.portal_catalog.getObject(last_affectation_list[0].node_uid)\n
site = portal.portal_catalog.getObject(last_affectation_list[0].node_uid)\n
return site\n
\n
return None\n
......
278
\ No newline at end of file
279
\ 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