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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 16 15:26:09 CET 2008


Author: romain
Date: Wed Jan 16 15:26:08 2008
New Revision: 18742

URL: http://svn.erp5.org?rev=18742&view=rev
Log:
Do not delete the complete chain, but only the uninstalled part.

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=18742&r1=18741&r2=18742&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Wed Jan 16 15:26:08 2008
@@ -1612,7 +1612,18 @@
       portal_type = path_splitted[1]
       id = 'chain_%s' % portal_type
       if id in chain_dict.keys():
-        del chain_dict[id]
+        chain = chain_dict[id]
+        # It should be better to use regexp
+        chain = chain.replace(' ', '')
+        workflow_list = chain.split(',')
+        workflow_id = self._objects[path]
+        for i in range(workflow_list.count(workflow_id)):
+          workflow_list.remove(workflow_id)
+        chain = ', '.join(workflow_list)
+        if chain == '':
+          del chain_dict[id]
+        else:
+          chain_dict[id] = chain
     context.portal_workflow.manage_changeWorkflows('', props=chain_dict)
 
   def preinstall(self, context, installed_bt, **kw):




More information about the Erp5-report mailing list