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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 30 16:27:35 CET 2009


Author: kazuhiko
Date: Fri Oct 30 16:27:31 2009
New Revision: 30164

URL: http://svn.erp5.org?rev=30164&view=rev
Log:
modify r30158 change because several tools still use CMF actions:
> now we need to find action information object by matching 'reference' instead of 'id'. with this fix, action can be successfully removed. and if action if missing, we output log just same as portal type itself is missing.

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=30164&r1=30163&r2=30164&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Fri Oct 30 16:27:31 2009
@@ -2551,10 +2551,14 @@
     for id in keys:
       if  '|' in id:
         relative_url, value = id.split(' | ')
-        key = 'reference'
+        obj = p.unrestrictedTraverse(relative_url, None)
+        # Several tools still use CMF actions
+        if obj is not None:
+          is_new_action = obj.getParentId() == 'portal_types'
+          key = is_new_action and 'reference' or 'id'
       else:
         relative_url, key, value = self._splitPath(id)
-      obj = p.unrestrictedTraverse(relative_url, None)
+        obj = p.unrestrictedTraverse(relative_url, None)
       if obj is not None:
         action_list = obj.listActions()
         for index in range(len(action_list)):




More information about the Erp5-report mailing list