Commit ad6c597f authored by Alexandre Boeglin's avatar Alexandre Boeglin

Order Path list

Don't export _roles property in PortalType
Bugfix when no PortalTypeRole exist


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5349 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 340ffc31
...@@ -968,7 +968,6 @@ class WorkflowTemplateItem(ObjectTemplateItem): ...@@ -968,7 +968,6 @@ class WorkflowTemplateItem(ObjectTemplateItem):
else: else:
ObjectTemplateItem.install(self, context, trashbin, **kw) ObjectTemplateItem.install(self, context, trashbin, **kw)
class PortalTypeTemplateItem(ObjectTemplateItem): class PortalTypeTemplateItem(ObjectTemplateItem):
...@@ -1026,6 +1025,8 @@ class PortalTypeTemplateItem(ObjectTemplateItem): ...@@ -1026,6 +1025,8 @@ class PortalTypeTemplateItem(ObjectTemplateItem):
setattr(obj, 'property_sheet_list', ()) setattr(obj, 'property_sheet_list', ())
if hasattr(obj, 'base_category_list'): if hasattr(obj, 'base_category_list'):
setattr(obj, 'base_category_list', ()) setattr(obj, 'base_category_list', ())
if hasattr(obj, '_roles'):
setattr(obj, '_roles', [])
self._objects[relative_url] = obj self._objects[relative_url] = obj
obj.wl_clearLocks() obj.wl_clearLocks()
# also export workflow chain # also export workflow chain
...@@ -1728,7 +1729,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem): ...@@ -1728,7 +1729,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
path = 'portal_types/%s' % roles_path.split('/', 1)[1] path = 'portal_types/%s' % roles_path.split('/', 1)[1]
obj = p.unrestrictedTraverse(path) obj = p.unrestrictedTraverse(path)
setattr(obj, '_roles', []) # reset roles before applying setattr(obj, '_roles', []) # reset roles before applying
type_roles_list = self._objects[roles_path] type_roles_list = self._objects[roles_path] or []
for type_role_property_dict in type_roles_list: for type_role_property_dict in type_roles_list:
obj._roles.append(RoleInformation(**type_role_property_dict)) obj._roles.append(RoleInformation(**type_role_property_dict))
...@@ -3806,6 +3807,13 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -3806,6 +3807,13 @@ Business Template is a set of definitions, such as skins, portal types and categ
""" """
return self._getOrderedList('template_portal_type_id') return self._getOrderedList('template_portal_type_id')
def getTemplatePathList(self):
"""
We have to set this method because we want an
ordered list
"""
return self._getOrderedList('template_path')
def getTemplatePortalTypeAllowedContentTypeList(self): def getTemplatePortalTypeAllowedContentTypeList(self):
""" """
We have to set this method because we want an We have to set this method because we want an
......
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