[Erp5-report] r29879 - /erp5/trunk/products/ERP5Type/patches/ActionInformation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 21 16:14:34 CEST 2009


Author: leonardo
Date: Wed Oct 21 16:14:33 2009
New Revision: 29879

URL: http://svn.erp5.org?rev=29879&view=rev
Log:
Reinstate ActionInfo key removed by CMF 2.2 but used by templates in our BusinessTemplates. Also make sure not to obliterate newly provided keys on ActionInformation (not to be confused with ActionInfo). (approved by jm)

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

Modified: erp5/trunk/products/ERP5Type/patches/ActionInformation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/ActionInformation.py?rev=29879&r1=29878&r2=29879&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/ActionInformation.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/ActionInformation.py [utf8] Wed Oct 21 16:14:33 2009
@@ -135,20 +135,16 @@
                              , icon=self.getIconExpression()
                              )
 
+    ActionInformation_getMapping = ActionInformation.getMapping 
     def getMapping(self):
         """ Get a mapping of this object's data.
         """
-        return { 'id': self.id,
-                 'title': self.title or self.id,
-                 'description': self.description,
-                 'category': self.category or 'object',
-                 'condition': getattr(self, 'condition', None)
-                              and self.condition.text or '',
-                 'permissions': self.permissions,
-                 'visible': bool(self.visible),
-                 'action': self.getActionExpression(),
-                 'icon': self.getIconExpression(),
-                 'priority': self.getPriority() }
+        mapping = ActionInformation_getMapping(self)
+        # missing on CMF 1.5, provided as icon_expression on CMF 2
+        mapping['icon'] = icon=self.getIconExpression()
+        # missing on both CMF 1.5 and 2
+        mapping['priority'] = self.getPriority()
+        return mapping
 
 ActionInformation.__init__ = __init__
 ActionInformation.getAction = getAction
@@ -175,6 +171,8 @@
         self._lazy_keys.append('icon')
       else:
         self.data['icon'] = ''
+      # put back 'name' if it's not there. CMF 2.x removes it.
+      self.data['name'] = self.data['title']
 
   def _getIcon(self):
     # ivan




More information about the Erp5-report mailing list