Commit 7955aa81 authored by Julien Muchembled's avatar Julien Muchembled

Do not use spec/meta_type of object{Ids,Values}

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/portal_types@29246 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 59ccb88d
......@@ -2463,7 +2463,7 @@ class ActionTemplateItem(ObjectTemplateItem):
for path, action_dict in portal_type_dict.iteritems():
container = p.unrestrictedTraverse(path)
container.manage_delObjects([obj.id
for obj in container.objectValues(meta_type='ERP5 Action Information')
for obj in container.objectValues(portal_type='Action Information')
if obj.reference in action_dict])
for obj in action_dict.itervalues():
container._importOldAction(obj)
......@@ -2544,7 +2544,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
obj = p.unrestrictedTraverse("portal_types/%s" %
relative_url.split('/', 1)[1])
self._objects[relative_url] = type_role_list = []
for role in obj.objectValues(meta_type='ERP5 Role Information'):
for role in obj.objectValues(portal_type='Role Information'):
type_role_dict = {}
for k, v in aq_base(role).__getstate__().iteritems():
if k == 'condition':
......@@ -2647,8 +2647,8 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
obj = p.unrestrictedTraverse(path, None)
if obj is not None:
# reset roles before applying
obj.manage_delObjects(list(
obj.objectIds(spec='ERP5 Role Information')))
obj.manage_delObjects([x.id
for x in obj.objectValues(portal_type='Role Information')])
type_roles_list = self._objects[roles_path] or []
for role_property_dict in type_roles_list:
obj._importRole(role_property_dict)
......
......@@ -378,7 +378,8 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
base_cat.manage_delObjects(list(base_cat.objectIds()))
# clear role definitions
for ti in self.getTypesTool().objectValues():
ti.manage_delObjects(list(ti.objectIds(spec='ERP5 Role Information')))
ti.manage_delObjects([x.id
for x in ti.objectValues(portal_type='ERP5 Role Information')])
# clear modules
for module in self.portal.objectValues():
if module.getId().endswith('_module'):
......
......@@ -245,7 +245,7 @@ class ERP5TypeInformation(XMLObject,
# which acquire their security definition from their parent
# The downside of this optimisation is that it is not possible to
# set a local role definition if the local role list is empty
if len(self.objectValues(meta_type='ERP5 Role Information')):
if len(self.objectValues(portal_type='Role Information')):
self.updateLocalRolesOnObject(ob)
# notify workflow after generating local roles, in order to prevent
......@@ -528,7 +528,7 @@ class ERP5TypeInformation(XMLObject,
folder = aq_parent(folder)
ec = createExprContext(folder, portal, ob)
for role in self.objectValues(meta_type='ERP5 Role Information'):
for role in self.objectValues(portal_type='Role Information'):
if role.testCondition(ec):
yield role
......
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