[Erp5-report] r29733 - /erp5/trunk/products/ERP5Type/Core/ActionInformation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 16 10:34:21 CEST 2009


Author: kazuhiko
Date: Fri Oct 16 10:34:19 2009
New Revision: 29733

URL: http://svn.erp5.org?rev=29733&view=rev
Log:
we cache cloned Expressions because original ones are persistent objects.

Modified:
    erp5/trunk/products/ERP5Type/Core/ActionInformation.py

Modified: erp5/trunk/products/ERP5Type/Core/ActionInformation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Core/ActionInformation.py?rev=29733&r1=29732&r2=29733&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Core/ActionInformation.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Core/ActionInformation.py [utf8] Fri Oct 16 10:34:19 2009
@@ -179,15 +179,26 @@
   def getRawActionInformation(self):
     """Return RawActionInformation instance that is not persistent and
     is cacheable."""
+    # we cache cloned Expressions because original ones are persistent
+    # objects.
+    icon = self.getIcon()
+    if icon is not None:
+      icon = Expression(icon.text)
+    action = self.getAction()
+    if action is not None:
+      action = Expression(action.text)
+    condition = self.getCondition()
+    if condition is not None:
+      condition = Expression(condition.text)
     return RawActionInformation(
       {'id':self.getReference(),
        'name':self.getTitle(),
        'description':self.getDescription(),
        'category':self.getActionType(),
        'priority':self.getFloatIndex(),
-       'icon':self.getIcon(),
-       'action':self.getAction(),
-       'condition':self.getCondition(),
+       'icon':icon,
+       'action':action,
+       'condition':condition,
        'action_permission':self.getActionPermissionList(),
        }
       )




More information about the Erp5-report mailing list