Commit 7965f340 authored by Alexandre Boeglin's avatar Alexandre Boeglin

If simple method of getDefaultModuleId works, no need to try the more complex

one.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15228 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8e4d4241
...@@ -938,9 +938,11 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -938,9 +938,11 @@ class ERP5Site(FolderMixIn, CMFSite):
if portal_object._getOb(expected_module_id, None) is not None: if portal_object._getOb(expected_module_id, None) is not None:
module_id = expected_module_id module_id = expected_module_id
expected_module_id += '_module' expected_module_id += '_module'
if portal_object._getOb(expected_module_id, None) is not None: if module is None and portal_object._getOb(expected_module_id, None) \
is not None:
module_id = expected_module_id module_id = expected_module_id
# then look for module where the type is allowed # 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',)): for expected_module_id in portal_object.objectIds(spec=('ERP5 Folder',)):
module = portal_object._getOb(expected_module_id, None) module = portal_object._getOb(expected_module_id, None)
if module is not None: if module is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment