[Erp5-report] r32303 kazuhiko - /erp5/trunk/products/ERP5/Document/SolverTypeInformation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Feb 8 04:01:12 CET 2010


Author: kazuhiko
Date: Mon Feb  8 04:01:11 2010
New Revision: 32303

URL: http://svn.erp5.org?rev=32303&view=rev
Log:
initial implementation of getDefaultConfigurationPropertyDict.

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

Modified: erp5/trunk/products/ERP5/Document/SolverTypeInformation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SolverTypeInformation.py?rev=32303&r1=32302&r2=32303&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SolverTypeInformation.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SolverTypeInformation.py [utf8] Mon Feb  8 04:01:11 2010
@@ -29,6 +29,7 @@
 from AccessControl import ClassSecurityInfo
 from Products.ERP5Type import Permissions, PropertySheet
 from Products.ERP5Type.ERP5Type import ERP5TypeInformation
+from Products.ERP5Type.Cache import getReadOnlyTransactionCache
 
 class SolverTypeInformation(ERP5TypeInformation):
   """
@@ -82,6 +83,25 @@
     """
     # Implemented through type based method
     # and using read transaction cache
+    if configurable.getPortalType() == 'Solver Decision':
+      try:
+        solver_portal_type = configurable.getSolverValue().getId()
+      except AttributeError:
+        return {}
+    else:
+      solver_portal_type = configurable.getPortalType()
+
+    cache = getReadOnlyTransactionCache(self)
+    if cache is not None:
+      key = ('getDefaultConfigurationPropertyDict', solver_portal_type)
+      try:
+        method = cache[key]
+      except KeyError:
+        method = self._getTypeBasedMethod(
+          'getDefaultConfigurationPropertyDict',
+          fallback_script_id='Solver_getDefaultConfigurationPropertyDict')
+        cache[key] = method
+    return method(configurable)
 
   def getDefaultConfigurationPropertyList(self, id, configurable):
     """




More information about the Erp5-report mailing list