Commit 4539c119 authored by Jérome Perrin's avatar Jérome Perrin

Don't propose all organisations in inventory chart dialog, but only sections...

Don't propose all organisations in inventory chart dialog, but only sections that have been used in movements with this resources (calculated with getInventoryList)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24925 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8157a820
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Returns an item list of all mirror sections that have been used in movements with this resource.\n
"""\n
\n
item_list = [(\'\', \'\')]\n
portal = context.getPortalObject()\n
getobject = portal.portal_catalog.getobject\n
\n
for x in portal.portal_simulation.getInventoryList(\n
resource_uid=context.getUid(),\n
group_by_mirror_section=1):\n
mirror_section_uid = x.mirror_section_uid\n
if mirror_section_uid:\n
mirror_section = getobject(mirror_section_uid)\n
item_list.append((mirror_section.getTitle(),\n
mirror_section.getRelativeUrl()))\n
\n
item_list.sort(key=lambda x:x[0])\n
return item_list\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>item_list</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>getobject</string>
<string>_getiter_</string>
<string>x</string>
<string>mirror_section_uid</string>
<string>mirror_section</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_getMovementedSectionItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -133,7 +133,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'\',\'\')] + [(x.getTitle(),x.getRelativeUrl()) for x in context.portal_catalog(portal_type=\'Organisation\',sort_on=((\'title\',\'ascending\'),))]</string> </value>
<value> <string>here/Resource_getMovementedSectionItemList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -133,7 +133,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'\',\'\')] + [(x.getTitle(),x.getRelativeUrl()) for x in context.portal_catalog(portal_type=\'Organisation\',sort_on=((\'title\',\'ascending\'),))]</string> </value>
<value> <string>here/Resource_getMovementedSectionItemList</string> </value>
</item>
</dictionary>
</pickle>
......
294
\ No newline at end of file
295
\ 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