diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index f94fa35f884e60cffd6a2f4b4e673016396a8dd6..971f0daa9031c6bcfb63d95ab0bcc490a999eeb0 100644 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -2323,11 +2323,8 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem): if prop_value: type_role_dict['condition'] = prop_value.text # multi - for property in ('category', 'base_category'): - prop_value_list = [] - for prop_value in getattr(role, property): - prop_value_list.append(prop_value) - type_role_dict[property] = prop_value_list + type_role_dict['category'] = role.getCategory() + type_role_dict['base_category'] = role.getBaseCategory() type_role_list.append(type_role_dict) self._objects[relative_url] = type_role_list diff --git a/product/ERP5/tests/testBusinessTemplate.py b/product/ERP5/tests/testBusinessTemplate.py index fdc6a301cbab5f918c0f32b55ce641ce8794b6ab..1d9a1bb81eb42ee8dfc17d1da313f2fe97325205 100644 --- a/product/ERP5/tests/testBusinessTemplate.py +++ b/product/ERP5/tests/testBusinessTemplate.py @@ -4935,8 +4935,8 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): name='Geek Role Definition', condition='', category='group/g1\nfunction/f1\n', - base_category_script='', - base_category='',) + base_category_script='Base Category Script', + base_category='group site',) sequence.edit(portal_type_role='geek_role_definition') @@ -4968,6 +4968,8 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): self.assertEquals('Geek Role Definition', role.title) self.assertEquals('A definition with non ascii chars 茅脿猫', role.description) self.assertEquals(('group/g1','function/f1'), role.getCategory()) + self.assertEquals(('group','site'), role.getBaseCategory()) + self.assertEquals('Base Category Script', role.getBaseCategoryScript()) def test_36_CheckPortalTypeRoles(self, quiet=quiet, run=run_all_test): if not run: return