[Erp5-report] r38899 kazuhiko - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 5 16:40:41 CEST 2010


Author: kazuhiko
Date: Tue Oct  5 16:40:40 2010
New Revision: 38899

URL: http://svn.erp5.org?rev=38899&view=rev
Log:
do not append non-existing information for is_bt_for_diff case, otherwise we cannot notice missing information (like 'Allowed Content Types' etc.) in the 'reinstall' dialog.

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

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=38899&r1=38898&r2=38899&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Tue Oct  5 16:40:40 2010
@@ -2173,15 +2173,16 @@ class PortalTypeAllowedContentTypeTempla
       if ob is None:
         raise ValueError, "Portal Type %s not found in site" %(portal_type,)
       prop_value = getattr(ob, self.class_property, ())
-      if not allowed_type in prop_value and not self.is_bt_for_diff:
+      if allowed_type in prop_value:
+        if self.class_property not in portal_type:
+          key = '%s/%s' % (self.class_property, portal_type)
+        else:
+          key = portal_type
+        self._objects.setdefault(key, []).append(allowed_type)
+      elif not self.is_bt_for_diff:
         raise ValueError, "%s %s not found in portal type %s" % (
                              getattr(self, 'name', self.__class__.__name__),
                              allowed_type, portal_type)
-      if self.class_property not in portal_type:
-        key = '%s/%s' % (self.class_property, portal_type)
-      else:
-        key = portal_type
-      self._objects.setdefault(key, []).append(allowed_type)
 
   # Function to generate XML Code Manually
   def generateXml(self, path=None):




More information about the Erp5-report mailing list