diff --git a/product/ERP5Type/dynamic/portal_type_class.py b/product/ERP5Type/dynamic/portal_type_class.py
index 3736eef436d503f180745b7af46a7386b97c375c..448d2301d3d5f34ac189135715085d7648900445 100644
--- a/product/ERP5Type/dynamic/portal_type_class.py
+++ b/product/ERP5Type/dynamic/portal_type_class.py
@@ -235,6 +235,7 @@ def generatePortalTypeClass(portal_type_name):
       LOG("ERP5Type.dynamic", WARNING,
           "Property Sheet Tool was not found. Please update erp5_core "
           "Business Template")
+    else:
       if portal_type is not None:
         # Get the Property Sheets defined on the portal_type and use the
         # ZODB Property Sheet rather than the filesystem only if it