Commit 6bbcd85b authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

erp5_core: Display workflow and ZODB history in desceding sorting

parent 2b143c22
...@@ -136,7 +136,7 @@ def getChangeHistoryList(document, size=50, attribute_name=None): ...@@ -136,7 +136,7 @@ def getChangeHistoryList(document, size=50, attribute_name=None):
history.extend(_getWorkflowHistory(document, initial_datetime)) history.extend(_getWorkflowHistory(document, initial_datetime))
history.extend(_getRecordedPropertyHistory(document, size)) history.extend(_getRecordedPropertyHistory(document, size))
history.extend(_getAttributeHistory(document, size, attribute_name)) history.extend(_getAttributeHistory(document, size, attribute_name))
history.sort(key=lambda x:x['datetime']) history.sort(key=lambda x:x['datetime'], reverse=True)
return history return history
......
...@@ -92,4 +92,6 @@ for workflow_item in workflow_item_list: ...@@ -92,4 +92,6 @@ for workflow_item in workflow_item_list:
previous_obj = o previous_obj = o
result.append(o) result.append(o)
if reverse:
result.reverse()
return result return result
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>workflow_id, display=1, **kw</string> </value> <value> <string>workflow_id, display=1, reverse=False, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<value> <value>
<list> <list>
<string>columns</string> <string>columns</string>
<string>default_params</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>list_action</string> <string>list_action</string>
<string>list_method</string> <string>list_method</string>
...@@ -62,6 +63,12 @@ ...@@ -62,6 +63,12 @@
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>default_params</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -74,6 +81,10 @@ ...@@ -74,6 +81,10 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>list_action</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -89,7 +100,7 @@ ...@@ -89,7 +100,7 @@
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -144,6 +155,17 @@ ...@@ -144,6 +155,17 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>default_params</string> </key>
<value>
<list>
<tuple>
<string>checked_permission</string>
<string>View</string>
</tuple>
</list>
</value>
</item>
<item> <item>
<key> <string>disable_link</string> </key> <key> <string>disable_link</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -194,7 +216,7 @@ ...@@ -194,7 +216,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -274,12 +296,25 @@ ...@@ -274,12 +296,25 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.portal_selections.getSelectionParams(request.get(\'prefixed_selection_name\', field.get_orig_value(\'selection_name\')))[\'workflow_title\']</string> </value> <value> <string>python: [(\'checked_permission\', \'View\'), (\'reverse\', True)]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.portal_selections.getSelectionParams(request.get(\'prefixed_selection_name\', field.get_orig_value(\'selection_name\')))[\'workflow_title\']</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
</pickle> </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