From f90d9d1cfafb06ec9c371532998c1b3e39176501 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Fri, 2 Oct 2009 15:16:33 +0000
Subject: [PATCH] wip

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/portal_types@29391 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Core/ActionInformation.py | 30 +++++++++++-----------
 product/ERP5Type/ERP5Type.py               |  4 +--
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/product/ERP5Type/Core/ActionInformation.py b/product/ERP5Type/Core/ActionInformation.py
index e0bfcdada1..31d012fe4f 100644
--- a/product/ERP5Type/Core/ActionInformation.py
+++ b/product/ERP5Type/Core/ActionInformation.py
@@ -120,22 +120,22 @@ class ActionInformation(XMLObject):
       value = value and Expression(value) or None
     self._baseSetIcon(value)
 
-  def getAction(self):
-    """Overridden getter for 'action' to clean null values"""
-    if getattr(aq_base(self), 'action', None) == '':
-      del self.action
-    return self._baseGetAction()
-
-  def getCondition(self):
-    """Overridden getter for 'condition' to clean null values"""
-    if getattr(aq_base(self), 'condition', None) == '':
-      del self.condition
-    return self._baseGetCondition()
-
+#  def getAction(self):
+#    """Overridden getter for 'action' to clean null values"""
+#    if getattr(aq_base(self), 'action', None) == '':
+#      del self.action
+#    return self._baseGetAction()
+#
+#  def getCondition(self):
+#    """Overridden getter for 'condition' to clean null values"""
+#    if getattr(aq_base(self), 'condition', None) == '':
+#      del self.condition
+#    return self._baseGetCondition()
+#
   def getIcon(self):
-    """Overridden getter for 'icon' to clean null values"""
-    if getattr(aq_base(self), 'icon', None) == '':
-      del self.icon
+    """Explicit getter for 'icon' to override DynamicType.getIcon from CMF"""
+#    if getattr(aq_base(self), 'icon', None) == '':
+#      del self.icon
     return self._baseGetIcon()
 
   security.declareProtected(AccessContentsInformation, 'getActionText')
diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py
index 10230f5cae..fefff98ee1 100644
--- a/product/ERP5Type/ERP5Type.py
+++ b/product/ERP5Type/ERP5Type.py
@@ -234,8 +234,6 @@ class ERP5TypeInformation(XMLObject,
     isPortalContent = 1
     isRADContent = 1
 
-    # ILocalRoleAssignor
-
     security = ClassSecurityInfo()
     security.declareObjectProtected(Permissions.AccessContentsInformation)
 
@@ -594,7 +592,7 @@ class ERP5TypeInformation(XMLObject,
       action = ActionInformation(self.generateNewId())
       for k, v in old_action.iteritems():
         if k in ('action', 'condition', 'icon'):
-          if not v:
+          if not v or not v.text:
             continue
           v = v.__class__(v.text)
         setattr(action, {'id': 'reference',
-- 
2.30.9