Commit d1ae37aa authored by Arnaud Fontaine's avatar Arnaud Fontaine

When setting up an ERP5Site, loading Base Type Portal Type would fail

as there are no Portal Types definitions yet


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40762 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 17483150
...@@ -182,12 +182,19 @@ def generatePortalTypeClass(portal_type_name): ...@@ -182,12 +182,19 @@ def generatePortalTypeClass(portal_type_name):
# Moreover, some tools, such as 'Activity Tool', don't have any # Moreover, some tools, such as 'Activity Tool', don't have any
# portal type # portal type
if type_class is None: if type_class is None:
# Try to figure out a coresponding document class from the document side. if portal_type_name in core_portal_type_class_dict:
# This can happen when calling newTempAmount for instance: # Only happen when portal_types is empty (e.g. when creating a
# Amount has no corresponding Base Type and will never have one # new ERP5Site)
# But the semantic of newTempXXX requires us to create an type_class = core_portal_type_class_dict[portal_type_name]['type_class']
# object using the Amount Document, so we promptly do it: else:
type_class = portal_type_name.replace(' ', '') # Try to figure out a coresponding document class from the
# document side. This can happen when calling newTempAmount for
# instance:
# Amount has no corresponding Base Type and will never have one
# But the semantic of newTempXXX requires us to create an
# object using the Amount Document, so we promptly do it:
type_class = portal_type_name.replace(' ', '')
mixin_list = [] mixin_list = []
interface_list = [] interface_list = []
......
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