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 @@
<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
\n
\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(\n
last_affectation_list = portal.portal_simulation.getCurrentTrackingList(\n
item=context.getRelativeUrl())\n
if not last_affectation_list:\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 = context.portal_simulation.getCurrentTrackingList(\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
......@@ -72,8 +71,6 @@ if len(last_affectation_list) == 0:\n
if first_affectation_list[0].node_uid is not None:\n
site = context.portal_catalog.getObject(first_affectation_list[0].delivery_uid)\n
return site\n
\n
return None\n
</string> </value>
</item>
<item>
......@@ -112,9 +109,10 @@ return None\n
<tuple>
<string>at_date</string>
<string>DateTime</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>None</string>
<string>last_affectation_list</string>
<string>append</string>
<string>$append0</string>
......
......@@ -51,20 +51,17 @@
<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
\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
return None\n
\n
if last_affectation_list[0].section_uid is not None:\n
return context.portal_catalog.getObject(last_affectation_list[0].section_uid)\n
if not last_affectation_list:\n
last_affectation_list = portal.portal_simulation.getFutureTrackingList(\n
item=context.getRelativeUrl(), at_date=at_date)\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>
</item>
<item>
......@@ -103,11 +100,10 @@ return None\n
<tuple>
<string>at_date</string>
<string>DateTime</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>last_affectation_list</string>
<string>len</string>
<string>_getitem_</string>
</tuple>
</value>
......
......@@ -153,7 +153,8 @@ return history_list\n
<string>section_value</string>
<string>resource_value</string>
<string>None</string>
<string>$list0</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>_getitem_</string>
</tuple>
......
......@@ -124,7 +124,8 @@ return []\n
<string>last_affectation</string>
<string>None</string>
<string>movement</string>
<string>$list0</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>variation_list</string>
......
246
\ No newline at end of file
247
\ 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