Commit cc169622 authored by Jérome Perrin's avatar Jérome Perrin

Item_getCurrentOwnerValue: if item has no owner in current inventory, look at...

Item_getCurrentOwnerValue: if item has no owner in current inventory, look at future inventory, for cases when the item has still not moved, but there's a planned movement.
( + other minor or xml fixes )

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41294 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8286ee05
...@@ -51,19 +51,18 @@ ...@@ -51,19 +51,18 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n <value> <string>from DateTime import DateTime\n
portal = context.getPortalObject()\n
\n \n
if at_date is None:\n if at_date is None:\n
at_date = DateTime()\n at_date = DateTime()\n
\n \n
\n last_affectation_list = portal.portal_simulation.getCurrentTrackingList(\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(\n
item=context.getRelativeUrl())\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 = [x.getDate() for x in last_affectation_list]\n
last_affectation_date_list.sort()\n last_affectation_date_list.sort()\n
first_affectation_list = context.portal_simulation.getCurrentTrackingList(\n first_affectation_list = portal.portal_simulation.getCurrentTrackingList(\n
item=context.getRelativeUrl(),at_date=last_affectation_date_list[0])\n item=context.getRelativeUrl(),at_date=last_affectation_date_list[0])\n
\n \n
if len(last_affectation_list) == 0:\n if len(last_affectation_list) == 0:\n
...@@ -72,8 +71,6 @@ if len(last_affectation_list) == 0:\n ...@@ -72,8 +71,6 @@ if len(last_affectation_list) == 0:\n
if first_affectation_list[0].node_uid is not None:\n if first_affectation_list[0].node_uid is not None:\n
site = context.portal_catalog.getObject(first_affectation_list[0].delivery_uid)\n site = context.portal_catalog.getObject(first_affectation_list[0].delivery_uid)\n
return site\n return site\n
\n
return None\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -112,9 +109,10 @@ return None\n ...@@ -112,9 +109,10 @@ return None\n
<tuple> <tuple>
<string>at_date</string> <string>at_date</string>
<string>DateTime</string> <string>DateTime</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string>
<string>None</string>
<string>last_affectation_list</string> <string>last_affectation_list</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
......
...@@ -51,20 +51,17 @@ ...@@ -51,20 +51,17 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n <value> <string>from DateTime import DateTime\n
portal = context.getPortalObject()\n
\n \n
if at_date is None:\n last_affectation_list = portal.portal_simulation.getCurrentTrackingList(\n
at_date = DateTime()\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(\n
item=context.getRelativeUrl(), at_date=at_date)\n item=context.getRelativeUrl(), at_date=at_date)\n
\n \n
if len(last_affectation_list) == 0:\n if not last_affectation_list:\n
return None\n last_affectation_list = portal.portal_simulation.getFutureTrackingList(\n
\n item=context.getRelativeUrl(), at_date=at_date)\n
if last_affectation_list[0].section_uid is not None:\n
return context.portal_catalog.getObject(last_affectation_list[0].section_uid)\n
\n \n
return None\n if last_affectation_list and last_affectation_list[0].section_uid:\n
return portal.portal_catalog.getObject(last_affectation_list[0].section_uid)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -103,11 +100,10 @@ return None\n ...@@ -103,11 +100,10 @@ return None\n
<tuple> <tuple>
<string>at_date</string> <string>at_date</string>
<string>DateTime</string> <string>DateTime</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string>
<string>last_affectation_list</string> <string>last_affectation_list</string>
<string>len</string>
<string>_getitem_</string> <string>_getitem_</string>
</tuple> </tuple>
</value> </value>
......
...@@ -153,7 +153,8 @@ return history_list\n ...@@ -153,7 +153,8 @@ return history_list\n
<string>section_value</string> <string>section_value</string>
<string>resource_value</string> <string>resource_value</string>
<string>None</string> <string>None</string>
<string>$list0</string> <string>append</string>
<string>$append0</string>
<string>x</string> <string>x</string>
<string>_getitem_</string> <string>_getitem_</string>
</tuple> </tuple>
......
...@@ -124,7 +124,8 @@ return []\n ...@@ -124,7 +124,8 @@ return []\n
<string>last_affectation</string> <string>last_affectation</string>
<string>None</string> <string>None</string>
<string>movement</string> <string>movement</string>
<string>$list0</string> <string>append</string>
<string>$append0</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>x</string> <string>x</string>
<string>variation_list</string> <string>variation_list</string>
......
246 247
\ 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