[Erp5-report] r30490 - in /erp5/trunk/products/ERP5Type: ERP5Type.py patches/WorkflowTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 10 19:17:54 CET 2009


Author: jm
Date: Tue Nov 10 19:17:53 2009
New Revision: 30490

URL: http://svn.erp5.org?rev=30490&view=rev
Log:
Remove 2 other calls to reindexObject(Security) when creating an object

When an object was created, 2 activities were created:
 immediateReindexObject and recursiveImmediateReindexObject

This wasn't a major issue before [29672] because they have same group_method_id
Now that validated activities are executed in random order, 50% more
activities would be executed in 'tic' tests of testPerformance.

Modified:
    erp5/trunk/products/ERP5Type/ERP5Type.py   (contents, props changed)
    erp5/trunk/products/ERP5Type/patches/WorkflowTool.py

Modified: erp5/trunk/products/ERP5Type/ERP5Type.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ERP5Type.py?rev=30490&r1=30489&r2=30490&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] Tue Nov 10 19:17:53 2009
@@ -29,7 +29,7 @@
 from Products.CMFCore.TypesTool import FactoryTypeInformation
 from Products.CMFCore.Expression import Expression
 from Products.CMFCore.exceptions import AccessControl_Unauthorized
-from Products.CMFCore.utils import _checkPermission
+from Products.CMFCore.utils import _checkPermission, getToolByName
 from Products.ERP5Type import interfaces, Constraint, Permissions, PropertySheet
 from Products.ERP5Type.Base import getClassPropertyList
 from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
@@ -370,8 +370,10 @@
 
         # notify workflow after generating local roles, in order to prevent
         # Unauthorized error on transition's condition
-        if hasattr(aq_base(ob), 'notifyWorkflowCreated'):
-          ob.notifyWorkflowCreated()
+        workflow_tool = getToolByName(self, 'portal_workflow', None)
+        if workflow_tool is not None:
+          for workflow in workflow_tool.getWorkflowsFor(ob):
+            workflow.notifyCreated(ob)
 
         init_script = self.getTypeInitScriptId()
         if init_script:

Propchange: erp5/trunk/products/ERP5Type/ERP5Type.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: erp5/trunk/products/ERP5Type/patches/WorkflowTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/WorkflowTool.py?rev=30490&r1=30489&r2=30490&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/WorkflowTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/WorkflowTool.py [utf8] Tue Nov 10 19:17:53 2009
@@ -782,3 +782,6 @@
     return 0
 
 WorkflowTool.isTransitionPossible = WorkflowTool_isTransitionPossible
+
+WorkflowTool._reindexWorkflowVariables = lambda self, ob: \
+  hasattr(aq_base(ob), 'reindexObjectSecurity') and ob.reindexObjectSecurity()




More information about the Erp5-report mailing list