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 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -68,10 +65,12 @@ ...@@ -68,10 +65,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <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 \n
if result in [ [], (), None, \'\']:\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 \n
return result\n return result\n
</string> </value> </string> </value>
...@@ -88,6 +87,12 @@ return result\n ...@@ -88,6 +87,12 @@ return result\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -120,6 +125,8 @@ return result\n ...@@ -120,6 +125,8 @@ return result\n
<string>getattr</string> <string>getattr</string>
<string>context</string> <string>context</string>
<string>None</string> <string>None</string>
<string>listbox</string>
<string>dialog_id</string>
<string>result</string> <string>result</string>
</tuple> </tuple>
</value> </value>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -72,11 +69,13 @@ ...@@ -72,11 +69,13 @@
# by Base_viewRelatedObjectList from the relation field\n # by Base_viewRelatedObjectList from the relation field\n
result = None\n result = None\n
if parameter is not 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 \n
if result in [ [], (), None, \'\']:\n if result in [ [], (), None, \'\']:\n
\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 \n
return result\n return result\n
</string> </value> </string> </value>
...@@ -93,6 +92,12 @@ return result\n ...@@ -93,6 +92,12 @@ return result\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>parameter=None,**kw</string> </value> <value> <string>parameter=None,**kw</string> </value>
...@@ -128,6 +133,8 @@ return result\n ...@@ -128,6 +133,8 @@ return result\n
<string>_getattr_</string> <string>_getattr_</string>
<string>getattr</string> <string>getattr</string>
<string>context</string> <string>context</string>
<string>listbox</string>
<string>dialog_id</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
834 835
\ 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