Commit f7734b0c authored by Ayush Tiwari's avatar Ayush Tiwari

[erp5_core] Link to current value in new UI

parent c0b35430
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_hidden</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>display_current_value</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>107.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Display Current Value</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object.absolute_url() + \'/Base_viewCurrentValueForLargeText\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,24 +2,26 @@
This URL script returns the URL for current value for the
properties in the Historical Comparison Diff.
"""
from Products.ERP5Type.Log import log
if brain is None:
brain = context
# Get the name of property from the brain and send it as
# parameter to the next view
path = brain.getProperty('path')
property_name = path.split('/')[2]
log(context.aq_parent)
log(brain)
property_name = path.split('/')[-1]
if url_dict:
parent = brain.aq_parent
return {'command': 'push_history',
'options': {
'jio_key': context.getRelativeUrl(),
'jio_key': parent.getRelativeUrl(),
},
'view_kw': {
'jio_key': context.getRelativeUrl(),
'view': 'Base_viewCurrentValueForLargeText'
'jio_key': parent.getRelativeUrl(),
'view': 'display_current_value',
'extra_param_json': {
'property_name': property_name
}
}
}
......
......@@ -64,12 +64,13 @@ diff = portal_diff.diffPortalObject(
tempbase_list = []
uid = 900
for x in diff:
property_type = context.getPropertyType(x['path'])
# Check if the property type is in the list of property-types
# for the property_set sent via parameter
if property_type in PROPERTY_TYPE_LIST.get(property_set, ()):
temp_obj = newTempBase(portal,
temp_obj = newTempBase(context,
x['path'],
**x)
temp_obj.setProperty(
......
......@@ -160,6 +160,7 @@ portal_actions | component_tool
portal_actions | create_module
portal_actions | diff_multiple_object_action
portal_actions | diff_object_action
portal_actions | display_current_value
portal_actions | history
portal_actions | list_ui
portal_actions | make_template
......
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