Commit fc05b33b authored by Jérome Perrin's avatar Jérome Perrin

Business Template: Remove obsolete properties

Alias properties with storage id are enough, we don't need to declare those
properties.
parent 1a8cc3c1
......@@ -62,7 +62,7 @@ isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n
if business_template is not None:\n
# update role settings for modules which exists already\n
for portal_type in business_template.getTemplatePortalTypeRolesList():\n
for portal_type in business_template.getTemplatePortalTypeRoleList():\n
module_list = portal.contentValues(\n
filter=dict(portal_type=portal_type))\n
for module in module_list:\n
......
......@@ -79,7 +79,7 @@ bt5 = portal.portal_catalog.getResultValue(portal_type="Business Template",\n
title="erp5_web_ung_role")\n
\n
if bt5 is not None:\n
for portal_type in bt5.getTemplatePortalTypeRolesList():\n
for portal_type in bt5.getTemplatePortalTypeRoleList():\n
module_list = portal.contentValues(filter=dict(portal_type=portal_type))\n
portal_type_object = portal.portal_catalog.getResultValue(portal_type="Base Type",\n
id=portal_type)\n
......
......@@ -5852,14 +5852,18 @@ Business Template is a set of definitions, such as skins, portal types and categ
"""
wtool = self.getPortalObject().portal_workflow
ttool = self.getPortalObject().portal_types
bt_allowed_content_type_list = list(getattr(self, 'template_portal_type_allowed_content_type', []) or [])
bt_hidden_content_type_list = list(getattr(self, 'template_portal_type_hidden_content_type', []) or [])
bt_property_sheet_list = list(getattr(self, 'template_portal_type_property_sheet', []) or [])
bt_base_category_list = list(getattr(self, 'template_portal_type_base_category', []) or [])
bt_action_list = list(getattr(self, 'template_action_path', []) or [])
bt_allowed_content_type_list = list(
self.getTemplatePortalTypeAllowedContentTypeList())
bt_hidden_content_type_list = list(
self.getTemplatePortalTypeHiddenContentTypeList())
bt_property_sheet_list = list(
self.getTemplatePortalTypePropertySheetList())
bt_base_category_list = list(
self.getTemplatePortalTypeBaseCategoryList())
bt_action_list = list(self.getTemplateActionPathList())
bt_portal_types_id_list = list(self.getTemplatePortalTypeIdList())
bt_portal_type_roles_list = list(getattr(self, 'template_portal_type_roles', []) or [])
bt_wf_chain_list = list(getattr(self, 'template_portal_type_workflow_chain', []) or [])
bt_portal_type_roles_list = list(self.getTemplatePortalTypeRoleList())
bt_wf_chain_list = list(self.getTemplatePortalTypeWorkflowChainList())
for id in bt_portal_types_id_list:
portal_type = ttool.getTypeInfo(id)
......@@ -5923,14 +5927,13 @@ Business Template is a set of definitions, such as skins, portal types and categ
bt_action_list.sort()
bt_wf_chain_list.sort()
self.setProperty('template_portal_type_workflow_chain', bt_wf_chain_list)
self.setProperty('template_portal_type_roles', bt_portal_type_roles_list)
self.setProperty('template_portal_type_allowed_content_type', bt_allowed_content_type_list)
self.setProperty('template_portal_type_hidden_content_type', bt_hidden_content_type_list)
self.setProperty('template_portal_type_property_sheet', bt_property_sheet_list)
self.setProperty('template_portal_type_base_category', bt_base_category_list)
self.setProperty('template_action_path', bt_action_list)
return
self.setTemplatePortalTypeWorkflowChainList(bt_wf_chain_list)
self.setTemplatePortalTypeRoleList(bt_portal_type_roles_list)
self.setTemplatePortalTypeAllowedContentTypeList(bt_allowed_content_type_list)
self.setTemplatePortalTypeHiddenContentTypeList(bt_hidden_content_type_list)
self.setTemplatePortalTypePropertySheetList(bt_property_sheet_list)
self.setTemplatePortalTypeBaseCategoryList(bt_base_category_list)
self.setTemplateActionPathList(bt_action_list)
def guessPortalTypes(self, **kw):
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/lines</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>A list of local roles used by this template</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_local_roles_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: ()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/lines</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>A list of ERP5Types for which we want to add the roles in the template</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_portal_type_roles_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: ()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
60
\ No newline at end of file
61
\ No newline at end of file
......@@ -2335,7 +2335,7 @@ class BusinessTemplateMixin(TestDeveloperMixin, ERP5TypeTestCase, LogInterceptor
module_id = sequence.get('module_id')
bt = sequence.get('current_bt', None)
self.failUnless(bt is not None)
bt.edit(template_local_roles_list=[module_id])
bt.edit(template_local_role_list=[module_id])
def stepCheckLocalRolesExists(self, sequence=None, **kw):
"""
......@@ -3084,7 +3084,7 @@ class BusinessTemplateMixin(TestDeveloperMixin, ERP5TypeTestCase, LogInterceptor
ptype_ids.append(sequence.get('object_ptype_id', ''))
ptype_ids.append(sequence.get('module_ptype_id', ''))
self.assertEqual(len(ptype_ids), 2)
bt.edit(template_portal_type_roles_list=ptype_ids)
bt.edit(template_portal_type_role_list=ptype_ids)
def stepCheckPortalTypeRoleExists(self, sequence=None, **kw):
"""
......@@ -6654,7 +6654,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
bt = self.portal.portal_templates.newContent(
portal_type='Business Template',
title=self.id(),
template_local_roles_list=('geek_module/1',),
template_local_role_list=('geek_module/1',),
template_path_list=('geek_module/1',),
template_portal_type_role_list=('Geek Object',),)
......
......@@ -90,7 +90,7 @@ class PortalTypeRolesSpreadsheetConfiguratorItem(ConfiguratorItemMixin, XMLObjec
## Update BT5
bt5_obj = business_configuration.getSpecialiseValue()
if bt5_obj is not None:
bt5_obj.edit(template_portal_type_roles_list=portal_type_role_dict.keys())
bt5_obj.edit(template_portal_type_role_list=portal_type_role_dict.keys())
def checkSpreadSheetConsistency(self):
"""Check that the spread sheet is consistent with categories spreadsheet.
......
......@@ -99,6 +99,6 @@ class RoleConfiguratorItem(ConfiguratorItemMixin, XMLObject):
## Update BT5
bt5_obj = business_configuration.getSpecialiseValue()
# keep existing roles definition (from previous configuration saves)
for existing_type in bt5_obj.getTemplatePortalTypeRolesList():
for existing_type in bt5_obj.getTemplatePortalTypeRoleList():
portal_type_dict[existing_type] = 1
bt5_obj.edit(template_portal_type_roles_list=[i for i in portal_type_dict.keys() if i not in ignore_list])
bt5_obj.edit(template_portal_type_role_list=[i for i in portal_type_dict.keys() if i not in ignore_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