[Erp5-report] r10152 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 19 14:05:16 CEST 2006


Author: romain
Date: Tue Sep 19 14:05:15 2006
New Revision: 10152

URL: http://svn.erp5.org?rev=10152&view=rev
Log:
Folder_delete now uses Base_getWorkflowHistory, to get the workflow history of the object.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml?rev=10152&r1=10151&r2=10152&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml Tue Sep 19 14:05:15 2006
@@ -125,30 +125,14 @@
 \n
     for object in object_list:\n
 \n
-      workflow_id_list = [x.id for x in object.portal_workflow.getWorkflowsFor(object)]\n
-      # XXX Remove edit_workflow, which should no prevent deletion\n
-      try:\n
-        workflow_id_list.remove("edit_workflow")\n
-      except ValueError:\n
-        pass\n
-\n
-      # If a workflow manage a history, \n
-      # object should not be removed, but only put in state deleted\n
-      for wf_id in workflow_id_list:\n
-        # It is important to use the history variable\n
-        try:\n
-          list_history_item = context.portal_workflow.getInfoFor(\n
-                        ob=object, name="history", wf_id=wf_id)\n
-        # XXX Can not use WorkflowException\n
-        except ConflictError:\n
-          raise\n
-        except:\n
-          pass\n
-        else:\n
-          object_to_delete_list.append(object)\n
-          break\n
+      history_dict = object.Base_getWorkflowHistory()\n
+      history_dict.pop(\'edit_workflow\', None)\n
+      if history_dict == {}:\n
+        object_to_remove_list.append(object)\n
       else:\n
-        object_to_remove_list.append(object)\n
+        # If a workflow manage a history, \n
+        # object should not be removed, but only put in state deleted\n
+        object_to_delete_list.append(object)\n
 \n
     # Remove some objects\n
     try: \n
@@ -177,6 +161,8 @@
       # Change workflow state of others objects\n
       not_deleted_count = 0\n
       for object in object_to_delete_list:\n
+        # Hidden transition (without a message displayed) \n
+        # are not returned by getActionsFor\n
         try:\n
           context.getPortalObject().portal_workflow.doActionFor(\n
                       object,\n
@@ -297,10 +283,7 @@
                             <string>object_to_remove_list</string>
                             <string>object_to_delete_list</string>
                             <string>object</string>
-                            <string>workflow_id_list</string>
-                            <string>ValueError</string>
-                            <string>wf_id</string>
-                            <string>list_history_item</string>
+                            <string>history_dict</string>
                             <string>Exception</string>
                             <string>object_ids</string>
                             <string>comment</string>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=10152&r1=10151&r2=10152&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Tue Sep 19 14:05:15 2006
@@ -1,1 +1,1 @@
-72
+74




More information about the Erp5-report mailing list