[Erp5-report] r9232 - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 16 16:43:49 CEST 2006


Author: chris
Date: Wed Aug 16 16:43:47 2006
New Revision: 9232

URL: http://svn.erp5.org?rev=9232&view=rev
Log:
- Added an uninstall function for Workflow Chains

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=9232&r1=9231&r2=9232&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Wed Aug 16 16:43:47 2006
@@ -1328,6 +1328,17 @@
           chain_dict['chain_%s' % portal_type] = self._objects[path]
     context.portal_workflow.manage_changeWorkflows(default_chain,
                                                    props=chain_dict)
+  def uninstall(self, context, **kw):
+    (default_chain, chain_dict) = getChainByType(context)
+    for path in self._objects.keys():
+      path_splitted = path.split('/', 1)
+      if len(path_splitted) < 2:
+        continue
+      portal_type = path_splitted[1]
+      id = 'chain_%s' % portal_type
+      if id in chain_dict.keys():
+        del chain_dict[id]
+    context.portal_workflow.manage_changeWorkflows('', props=chain_dict)
 
   def _importFile(self, file_name, file):
     # import workflow chain for portal_type




More information about the Erp5-report mailing list