Commit 625fed8b authored by Jérome Perrin's avatar Jérome Perrin

get portal_types from the proxified listbox

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23088 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eaac9ebd
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<value> <string># This script is used in order to retrieve parameter in the listbox Displayed\n <value> <string># This script is used in order to retrieve parameter in the listbox Displayed\n
# by Base_viewRelatedObjectList from the relation field\n # by Base_viewRelatedObjectList from the relation field\n
result = None\n result = None\n
\n
if parameter is not None:\n if parameter is not None:\n
listbox = getattr(context, context.REQUEST.form_id, None).get_field( context.REQUEST.field_id )\n listbox = getattr(context, context.REQUEST.form_id, None).get_field( context.REQUEST.field_id )\n
dialog_id = listbox.get_value(\'relation_form_id\') or \'Base_viewRelatedObjectList\'\n dialog_id = listbox.get_value(\'relation_form_id\') or \'Base_viewRelatedObjectList\'\n
...@@ -77,6 +78,20 @@ if parameter is not None:\n ...@@ -77,6 +78,20 @@ if parameter is not None:\n
if parameter == \'proxy_listbox_ids\':\n if parameter == \'proxy_listbox_ids\':\n
return context.REQUEST.get(\'proxy_listbox_ids\', [])\n return context.REQUEST.get(\'proxy_listbox_ids\', [])\n
result = getattr(context, dialog_id, None).get_field( \'listbox\' ).get_orig_value(parameter)\n result = getattr(context, dialog_id, None).get_field( \'listbox\' ).get_orig_value(parameter)\n
\n
if parameter == \'portal_type\':\n
portal_type = listbox.get_value(\'portal_type\')\n
proxied_listbox = None\n
relation_field_proxy_listbox = context.Base_getRelationFieldProxyListBoxId()\n
if relation_field_proxy_listbox != \\\n
\'Base_viewRelatedObjectListBase/listbox\':\n
proxied_listbox = context.restrictedTraverse(\n
relation_field_proxy_listbox, None)\n
if proxied_listbox is None:\n
return portal_type\n
\n
proxied_listbox_portal_type = proxied_listbox.get_value(\'portal_types\')\n
return [x for x in proxied_listbox_portal_type if x in portal_type]\n
\n \n
return result\n return result\n
</string> </value> </string> </value>
...@@ -136,6 +151,14 @@ return result\n ...@@ -136,6 +151,14 @@ return result\n
<string>context</string> <string>context</string>
<string>listbox</string> <string>listbox</string>
<string>dialog_id</string> <string>dialog_id</string>
<string>portal_type</string>
<string>proxied_listbox</string>
<string>relation_field_proxy_listbox</string>
<string>proxied_listbox_portal_type</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<string>list_method</string> <string>list_method</string>
<string>count_method</string> <string>count_method</string>
<string>selection_name</string> <string>selection_name</string>
<string>portal_types</string>
<string>search</string> <string>search</string>
<string>select</string> <string>select</string>
<string>editable_columns</string> <string>editable_columns</string>
...@@ -71,6 +72,18 @@ ...@@ -71,6 +72,18 @@
<key> <string>count_method</string> </key> <key> <string>count_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>domain_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <value>
...@@ -87,6 +100,28 @@ ...@@ -87,6 +100,28 @@
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>portal_types</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>report_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>report_tree</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>select</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -94,9 +129,13 @@ ...@@ -94,9 +129,13 @@
<item> <item>
<key> <string>sort</string> </key> <key> <string>sort</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>stat_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -125,7 +164,7 @@ ...@@ -125,7 +164,7 @@
<item> <item>
<key> <string>count_method</string> </key> <key> <string>count_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -163,7 +202,13 @@ ...@@ -163,7 +202,13 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list/>
</value> </value>
</item> </item>
<item> <item>
...@@ -265,12 +310,28 @@ ...@@ -265,12 +310,28 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.Base_getRelatedObjectParameter(parameter=\'sort\')</string> </value> <value> <string>python: here.Base_getRelatedObjectParameter(parameter=\'portal_type\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU="> <record id="5" aka="AAAAAAAAAAU=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Base_getRelatedObjectParameter(parameter=\'sort\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
...@@ -286,7 +347,7 @@ ...@@ -286,7 +347,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="6" aka="AAAAAAAAAAY="> <record id="7" aka="AAAAAAAAAAc=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
......
935 936
\ 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