Commit d92a5589 authored by Romain Courteaud's avatar Romain Courteaud

Fix my_related_object_list field on Base_viewMetadata, which accessed all...

Fix my_related_object_list field on Base_viewMetadata, which accessed all related ZODB objects to display itself (which can lead to long transaction).
Instead, use a listbox with portal_catalog, which will only access displayed objects on the page.

Base_getRelatedObjectList was an unused script, so, no need to keep compatibility.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28168 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 92669256
...@@ -53,11 +53,8 @@ ...@@ -53,11 +53,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>category_tool = context.portal_categories\n <value> <string>kw[\'category.category_uid\'] = context.getUid()\n
base_category_list = kw.get(\'base_category_list\')\n return context.portal_catalog(**kw)\n
portal_type = kw.get(\'portal_type\')\n
\n
return category_tool.getRelatedValueList(context, base_category_list, portal_type=portal_type)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -97,9 +94,8 @@ return category_tool.getRelatedValueList(context, base_category_list, portal_typ ...@@ -97,9 +94,8 @@ return category_tool.getRelatedValueList(context, base_category_list, portal_typ
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>category_tool</string> <string>_write_</string>
<string>base_category_list</string> <string>_apply_</string>
<string>portal_type</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<string>left</string> <string>left</string>
<string>right</string> <string>right</string>
<string>center</string> <string>center</string>
<string>bottom</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -63,13 +64,19 @@ ...@@ -63,13 +64,19 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>center</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list> <list>
<string>my_related_object_list</string> <string>listbox</string>
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="MultiLinkField" module="Products.ERP5Form.MultiLinkField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_related_object_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Related Objects</string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[
<br />
]]></string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [x.absolute_url() for x in here.portal_categories.getRelatedValueList(here)]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x.getPath(), x.absolute_url()) for x in here.portal_categories.getRelatedValueList(here)]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1271 1273
\ 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