diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py index c9b940bf94299e27ca12beed8251723dd7b2d0fa..ebabf323806d2c8af9812d079ac330c0a9872bef 100644 --- a/product/ERP5/ERP5Site.py +++ b/product/ERP5/ERP5Site.py @@ -937,19 +937,19 @@ class ERP5Site(FolderMixIn, CMFSite): expected_module_id = portal_type.lower().replace(' ','_') if portal_object._getOb(expected_module_id, None) is not None: module_id = expected_module_id - expected_module_id += '_module' - if module_id is None and portal_object._getOb(expected_module_id, None) \ - is not None: - module_id = expected_module_id - # then look for module where the type is allowed - if module_id is None: - for expected_module_id in portal_object.objectIds(spec=('ERP5 Folder',)): - module = portal_object._getOb(expected_module_id, None) - if module is not None: - if portal_type in self.portal_types[module.getPortalType()].\ - allowed_content_types: - module_id = expected_module_id - break + else: + expected_module_id += '_module' + if portal_object._getOb(expected_module_id, None) is not None: + module_id = expected_module_id + # then look for module where the type is allowed + else: + for expected_module_id in portal_object.objectIds(spec=('ERP5 Folder',)): + module = portal_object._getOb(expected_module_id, None) + if module is not None: + if portal_type in self.portal_types[module.getPortalType()].\ + allowed_content_types: + module_id = expected_module_id + break if module_id is None: if default is not MARKER: