Commit e0ea2a0d authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_core: Provide better urls in ActivityTool_viewActivityList

Do not put links when no valid link exists. This makes copying values much
easier.
Do provide links to activity context and method.
Also, do not use TALES when it is not needed.
parent f27c534f
method_path = context.str_object_path + '/' + context.method_id
try:
method_value = context.getPortalObject().restrictedTraverse(method_path)
except Exception:
return
if getattr(method_value, 'manage_main', None) is not None:
return method_path + '/manage_main'
<?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>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityTool_getMessageMethodEditPath</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityTool_getMessagePath</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -78,9 +78,7 @@
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
</dictionary>
</value>
......@@ -185,7 +183,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
......@@ -262,7 +260,52 @@
<item>
<key> <string>url_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>delete</string>
<string>ActivityTool_deleteMessage</string>
</tuple>
<tuple>
<string>restart</string>
<string>ActivityTool_restartMessage</string>
</tuple>
<tuple>
<string>uid_activity</string>
<string></string>
</tuple>
<tuple>
<string>str_object_path</string>
<string>ActivityTool_getMessagePath</string>
</tuple>
<tuple>
<string>method_id</string>
<string>ActivityTool_getMessageMethodEditPath</string>
</tuple>
<tuple>
<string>activity_kw</string>
<string></string>
</tuple>
<tuple>
<string>arguments</string>
<string></string>
</tuple>
<tuple>
<string>kw</string>
<string></string>
</tuple>
<tuple>
<string>processing_node</string>
<string></string>
</tuple>
<tuple>
<string>retry</string>
<string></string>
</tuple>
<tuple>
<string>processing</string>
<string></string>
</tuple>
</list>
</value>
</item>
</dictionary>
......@@ -272,19 +315,6 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'delete\', \'ActivityTool_deleteMessage\'),(\'restart\', \'ActivityTool_restartMessage\')]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
......
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