[Erp5-report] r37898 aurel - /erp5/trunk/products/ERP5Type/patches/ActionsTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 19 10:58:54 CEST 2010


Author: aurel
Date: Thu Aug 19 10:58:51 2010
New Revision: 37898

URL: http://svn.erp5.org?rev=37898&view=rev
Log:
make button "Reorder actions by priority" on action tool work

Modified:
    erp5/trunk/products/ERP5Type/patches/ActionsTool.py

Modified: erp5/trunk/products/ERP5Type/patches/ActionsTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/ActionsTool.py?rev=37898&r1=37897&r2=37898&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/ActionsTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/ActionsTool.py [utf8] Thu Aug 19 10:58:51 2010
@@ -110,3 +110,16 @@ def listFilteredActionsFor(self, object=
     return filtered_actions
 
 ActionsTool.listFilteredActionsFor = listFilteredActionsFor
+
+
+def reorderActions(self, REQUEST=None):
+  """Reorder actions according to their priorities."""
+  new_actions = self._cloneActions()
+  new_actions.sort(key=lambda x: x.getPriority())
+  self._actions = tuple( new_actions )
+
+  if REQUEST is not None:
+    return self.manage_editActionsForm(REQUEST,
+        manage_tabs_message='Actions reordered.')
+
+ActionsTool.reorderActions = reorderActions




More information about the Erp5-report mailing list