Commit f20a3682 authored by Aurel's avatar Aurel

keep properties of portal types added by user when doing "guess

properties of portal types"


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5390 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b1b7ed51
...@@ -4240,14 +4240,14 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4240,14 +4240,14 @@ Business Template is a set of definitions, such as skins, portal types and categ
""" """
Fill field about properties for each portal type Fill field about properties for each portal type
""" """
bt_allowed_content_type_list = [] bt_allowed_content_type_list = list(getattr(self, 'template_portal_type_allowed_content_type', []) or [])
bt_hidden_content_type_list = [] bt_hidden_content_type_list = list(getattr(self, 'template_portal_type_hidden_content_type', []) or [])
bt_property_sheet_list = [] bt_property_sheet_list = list(getattr(self, 'template_portal_type_property_sheet', []) or [])
bt_base_category_list = [] bt_base_category_list = list(getattr(self, 'template_portal_type_base_category', []) or [])
bt_action_list = getattr(self, 'template_action_path', []) or [] bt_action_list = list(getattr(self, 'template_action_path', []) or [])
bt_action_list = list(bt_action_list)
bt_portal_types_id_list = list(self.getTemplatePortalTypeIdList()) bt_portal_types_id_list = list(self.getTemplatePortalTypeIdList())
bt_portal_type_roles_list = [] bt_portal_type_roles_list = list(getattr(self, 'template_portal_type_roles', []) or [])
p = self.getPortalObject() p = self.getPortalObject()
for id in bt_portal_types_id_list: for id in bt_portal_types_id_list:
try: try:
...@@ -4255,6 +4255,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4255,6 +4255,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
except KeyError: except KeyError:
continue continue
if len(getattr(portal_type, '_roles', ())) > 0: if len(getattr(portal_type, '_roles', ())) > 0:
if id not in bt_portal_type_roles_list:
bt_portal_type_roles_list.append(id) bt_portal_type_roles_list.append(id)
allowed_content_type_list = [] allowed_content_type_list = []
...@@ -4274,13 +4275,25 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4274,13 +4275,25 @@ Business Template is a set of definitions, such as skins, portal types and categ
action_list = [x.getId() for x in portal_type.listActions()] action_list = [x.getId() for x in portal_type.listActions()]
for a_id in allowed_content_type_list: for a_id in allowed_content_type_list:
bt_allowed_content_type_list.append(id+' | '+a_id) allowed_id = id+' | '+a_id
if allowed_id not in bt_allowed_content_type_list:
bt_allowed_content_type_list.append(allowed_id)
for h_id in hidden_content_type_list: for h_id in hidden_content_type_list:
bt_hidden_content_type_list.append(id+' | '+h_id) hidden_id = id+' | '+h_id
if hidden_id not in bt_hidden_content_type_list:
bt_hidden_content_type_list.append(hidden_id)
for ps_id in property_sheet_list: for ps_id in property_sheet_list:
bt_property_sheet_list.append(id+' | '+ps_id) p_sheet_id = id+' | '+ps_id
if p_sheet_id not in bt_property_sheet_list:
bt_property_sheet_list.append(p_sheet_id)
for bc_id in base_category_list: for bc_id in base_category_list:
bt_base_category_list.append(id+' | '+bc_id) base_cat_id = id+' | '+bc_id
if base_cat_id not in bt_base_category_list:
bt_base_category_list.append(base_cat_id)
for act_id in action_list: for act_id in action_list:
action_id = id+' | '+act_id action_id = id+' | '+act_id
if action_id not in bt_action_list: if action_id not in bt_action_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