Commit b806cf76 authored by Nicolas Delaby's avatar Nicolas Delaby

Falback with getFutureTrackingList to display useful informations on Item_view

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41280 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a854c2d8
......@@ -51,21 +51,28 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n
portal = context.getPortalObject()\n
\n
if at_date is None:\n
at_date = DateTime()\n
kw[\'at_date\'] = at_date\n
kw[\'item\'] = context.getRelativeUrl()\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(**kw)\n
last_affectation_list = portal.portal_simulation.getCurrentTrackingList(**kw)\n
\n
if kw.get(\'src__\',0):\n
return last_affectation_list\n
\n
if not last_affectation_list:\n
# Falback in Future inventory\n
if at_date is not None:\n
del kw[\'at_date\']\n
last_affectation_list = portal.portal_simulation.getFutureTrackingList(**kw)\n
\n
if len(last_affectation_list):\n
last_affectation = last_affectation_list[0]\n
if last_affectation.resource_uid is not None:\n
resource_value = context.portal_catalog.getObject(last_affectation.resource_uid)\n
resource_value = portal.portal_catalog.getObject(last_affectation.resource_uid)\n
return resource_value\n
\n
return None\n
......@@ -108,10 +115,11 @@ return None\n
<string>at_date</string>
<string>kw</string>
<string>DateTime</string>
<string>None</string>
<string>_write_</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>None</string>
<string>_write_</string>
<string>_apply_</string>
<string>last_affectation_list</string>
<string>len</string>
......
......@@ -51,7 +51,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n
\n
portal = context.getPortalObject()\n
\n
if at_date is None:\n
at_date = DateTime()\n
......@@ -59,15 +59,21 @@ kw[\'at_date\'] = at_date\n
\n
kw[\'item\'] = context.getRelativeUrl()\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(**kw)\n
last_affectation_list = portal.portal_simulation.getCurrentTrackingList(**kw)\n
\n
if kw.get(\'src__\',0):\n
return last_affectation_list\n
\n
if not last_affectation_list:\n
# Falback in Future inventory\n
if at_date is None:\n
del kw[\'at_date\']\n
last_affectation_list = portal.portal_simulation.getFutureTrackingList(**kw)\n
\n
if len(last_affectation_list):\n
last_affectation = last_affectation_list[0]\n
if last_affectation.delivery_uid is not None:\n
movement = context.portal_catalog.getObject(last_affectation.delivery_uid)\n
movement = portal.portal_catalog.getObject(last_affectation.delivery_uid)\n
return movement.getVariationCategoryList()\n
\n
return []\n
......@@ -110,10 +116,11 @@ return []\n
<string>at_date</string>
<string>kw</string>
<string>DateTime</string>
<string>None</string>
<string>_write_</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>None</string>
<string>_write_</string>
<string>_apply_</string>
<string>last_affectation_list</string>
<string>len</string>
......
......@@ -51,18 +51,24 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n
portal = context.getPortalObject()\n
\n
kw[\'at_date\'] = DateTime()\n
kw[\'item\'] = context.getRelativeUrl()\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(**kw)\n
last_affectation_list = portal.portal_simulation.getCurrentTrackingList(**kw)\n
\n
if kw.get(\'src__\',0):\n
return last_affectation_list\n
\n
if not last_affectation_list:\n
# Falback in Future inventory\n
last_affectation_list = portal.portal_simulation.getFutureTrackingList(**kw)\n
\n
if len(last_affectation_list):\n
last_affectation = last_affectation_list[0]\n
if last_affectation.delivery_uid is not None:\n
movement = context.portal_catalog.getObject(last_affectation.delivery_uid)\n
movement = portal.portal_catalog.getObject(last_affectation.delivery_uid)\n
variation_list = [x[0] for x in movement.getVariationCategoryItemList()]\n
variation = \',\'.join(variation_list)\n
return variation\n
......@@ -107,9 +113,10 @@ return []\n
<string>current</string>
<string>kw</string>
<string>DateTime</string>
<string>_write_</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>_write_</string>
<string>_apply_</string>
<string>last_affectation_list</string>
<string>len</string>
......@@ -117,8 +124,7 @@ return []\n
<string>last_affectation</string>
<string>None</string>
<string>movement</string>
<string>append</string>
<string>$append0</string>
<string>$list0</string>
<string>_getiter_</string>
<string>x</string>
<string>variation_list</string>
......
......@@ -51,6 +51,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n
portal = context.getPortalObject()\n
\n
if at_date is None:\n
at_date = DateTime()\n
......@@ -58,14 +59,21 @@ kw[\'at_date\'] = at_date\n
\n
kw[\'item\'] = context.getRelativeUrl()\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(**kw)\n
last_affectation_list = portal.portal_simulation.getCurrentTrackingList(**kw)\n
\n
if kw.get(\'src__\',0):\n
return last_affectation_list\n
\n
if not last_affectation_list:\n
# Falback in Future inventory\n
if at_date is None:\n
del kw[\'at_date\']\n
last_affectation_list = portal.portal_simulation.getFutureTrackingList(**kw)\n
\n
if len(last_affectation_list):\n
last_affectation = last_affectation_list[0]\n
if last_affectation.delivery_uid is not None:\n
movement = context.portal_catalog.getObject(last_affectation.delivery_uid)\n
movement = portal.portal_catalog.getObject(last_affectation.delivery_uid)\n
return movement.getVariationRangeCategoryItemList(display_base_category=0)\n
\n
return []\n
......@@ -108,10 +116,11 @@ return []\n
<string>at_date</string>
<string>kw</string>
<string>DateTime</string>
<string>None</string>
<string>_write_</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>None</string>
<string>_write_</string>
<string>_apply_</string>
<string>last_affectation_list</string>
<string>len</string>
......
234
\ No newline at end of file
236
\ 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