Commit 6ef49965 authored by Nicolas Delaby's avatar Nicolas Delaby

add support of customisable Form Dialog in Relation Fields

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21465 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 80af7a0a
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -68,10 +65,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>result = getattr(context, context.REQUEST.form_id, None).get_field( context.REQUEST.field_id ).get_value(\'columns\')\n
<value> <string>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
result = listbox.get_value(\'columns\')\n
\n
if result in [ [], (), None, \'\']:\n
result = getattr(context, \'Base_viewRelatedObjectList\', None).get_field( \'listbox\' ).get_value(\'columns\')\n
result = getattr(context, dialog_id, None).get_field( \'listbox\' ).get_value(\'columns\')\n
\n
return result\n
</string> </value>
......@@ -88,6 +87,12 @@ return result\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
......@@ -120,6 +125,8 @@ return result\n
<string>getattr</string>
<string>context</string>
<string>None</string>
<string>listbox</string>
<string>dialog_id</string>
<string>result</string>
</tuple>
</value>
......
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -72,11 +69,13 @@
# by Base_viewRelatedObjectList from the relation field\n
result = None\n
if parameter is not None:\n
result = getattr(context, context.REQUEST.form_id, None).get_field( context.REQUEST.field_id ).get_value(parameter)\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
result = listbox.get_value(parameter)\n
\n
if result in [ [], (), None, \'\']:\n
\n
result = getattr(context, \'Base_viewRelatedObjectList\', None).get_field( \'listbox\' ).get_orig_value(parameter)\n
result = getattr(context, dialog_id, None).get_field( \'listbox\' ).get_orig_value(parameter)\n
\n
return result\n
</string> </value>
......@@ -93,6 +92,12 @@ return result\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>parameter=None,**kw</string> </value>
......@@ -128,6 +133,8 @@ return result\n
<string>_getattr_</string>
<string>getattr</string>
<string>context</string>
<string>listbox</string>
<string>dialog_id</string>
</tuple>
</value>
</item>
......
834
\ No newline at end of file
835
\ 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