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
......@@ -969,7 +969,6 @@ class WorkflowTemplateItem(ObjectTemplateItem):
ObjectTemplateItem.install(self, context, trashbin, **kw)
class PortalTypeTemplateItem(ObjectTemplateItem):
workflow_chain = None
......@@ -1026,6 +1025,8 @@ class PortalTypeTemplateItem(ObjectTemplateItem):
setattr(obj, 'property_sheet_list', ())
if hasattr(obj, 'base_category_list'):
setattr(obj, 'base_category_list', ())
if hasattr(obj, '_roles'):
setattr(obj, '_roles', [])
self._objects[relative_url] = obj
obj.wl_clearLocks()
# also export workflow chain
......@@ -1728,7 +1729,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
path = 'portal_types/%s' % roles_path.split('/', 1)[1]
obj = p.unrestrictedTraverse(path)
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:
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
"""
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):
"""
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