Commit 7d11ff91 authored by Nicolas Delaby's avatar Nicolas Delaby

replace listfield by relation field

parent 5c41977b
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>"""Fallback on Event_getResourceItemList if found \n
ie: erp5_crm is installed\n
"""\n
from Products.ERP5Type.Cache import CachingMethod\n
portal = context.getPortalObject()\n
if getattr(portal, \'Event_getResourceItemList\', None) is not None:\n
portal_type = \'Mail Message\'\n
temp_event = portal.getDefaultModule(portal_type).newContent(portal_type=portal_type, temp_object=True)\n
return temp_event.Event_getResourceItemList()\n
\n
sql_kw = {\'portal_type\': portal.getPortalResourceTypeList(),\n
\'validation_state\': \'validated\',\n
\'sort_on\': \'title\'}\n
\n
def getResourceItemList():\n
return [(\'\', \'\')] + [(result.getTitle(), result.getRelativeUrl()) for result in portal.portal_catalog(**sql_kw)]\n
\n
getResourceItemList = CachingMethod(getResourceItemList, \n
id=(script.id, context.Localizer.get_selected_language()), \n
cache_factory=\'erp5_ui_long\')\n
\n
return getResourceItemList()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>NotificationMessage_getSpecialiseItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<list> <list>
<string>my_description</string> <string>my_description</string>
<string>my_aggregate_title_list</string> <string>my_aggregate_title_list</string>
<string>my_specialise</string> <string>my_specialise_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>items</string> <string>portal_type</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_specialise</string> </value> <value> <string>my_specialise_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>portal_type</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
...@@ -84,16 +84,21 @@ ...@@ -84,16 +84,21 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value> <value> <string>my_relation_field</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>portal_type</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>(To be defined in proxy field)</string>
<string>(To be defined in proxy field)</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -118,7 +123,7 @@ ...@@ -118,7 +123,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/NotificationMessage_getSpecialiseItemList</string> </value> <value> <string>python: zip(here.getPortalObject().getPortalResourceTypeList(), here.getPortalObject().getPortalResourceTypeList())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
980 981
\ 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