Commit a3ecc091 authored by Julien Muchembled's avatar Julien Muchembled

Remove some calls to deprecated functions

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/portal_types@29266 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d700d374
......@@ -2375,7 +2375,8 @@ class ActionTemplateItem(ObjectTemplateItem):
obj = p.unrestrictedTraverse(url)
is_new_action = obj.getParentId() == 'portal_types'
id_id = is_new_action and 'reference' or 'id'
for action in obj.listActions():
for action in (is_new_action and obj.getActionInformationList
or obj.listActions)():
if getattr(action, id_id) == value:
break
else:
......
......@@ -25,9 +25,10 @@
#
##############################################################################
import zope.interface
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.ERP5Type \
import ERP5TYPE_SECURITY_GROUP_ID_GENERATION_SCRIPT
......@@ -44,6 +45,8 @@ class RoleDefinition(XMLObject):
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
zope.interface.implements(interfaces.ILocalRoleGenerator)
# Default Properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
......
......@@ -1215,15 +1215,12 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id)
object_pt.addAction(
id = 'become_geek'
, name = 'Become Geek'
, action = 'become_geek_action'
, condition = ''
, permission = ('View', )
, category = 'object_action'
, visible = 1
, priority = 2.0 )
object_pt.newContent(portal_type='Action Information',
reference='become_geek',
title='Become Geek',
action='become_geek_action',
action_type='object_action',
float_index=2.0)
sequence.edit(first_action_id='become_geek')
def stepCreateEmptyAction(self, sequence=None, sequence_list=None, **kw):
......@@ -1233,14 +1230,10 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id)
object_pt.addAction(id = ''
, name = ' Nerd'
, action = ''
, condition = ''
, permission = ()
, category = ''
, visible = 1
, priority = 1.2)
object_pt.newContent(portal_type='Action Information',
title='Name',
action_permission_list=(),
float_index=1.2)
def stepCreateSecondAction(self, sequence=None, sequence_list=None, **kw):
"""
......@@ -1249,15 +1242,12 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id)
object_pt.addAction(
id = 'become_nerd'
, name = 'Become Nerd'
, action = 'become_nerd_action'
, condition = ''
, permission = ('View', )
, category = 'object_action'
, visible = 1
, priority = 1.5 )
object_pt.newContent(portal_type='Action Information',
reference='become_nerd',
title='Become Nerd',
action='become_nerd_action',
action_type='object_action',
float_index=1.5)
sequence.edit(second_action_id='become_nerd')
def stepCheckFirstActionExists(self, sequence=None, sequence_list=None, **kw):
......
......@@ -44,6 +44,7 @@ implements_tuple_list = [
('BusinessPath', 'IBusinessPath'),
('BusinessPath', 'ICategoryAccessProvider'),
('DeliveryLine', 'IDivergenceSolver'),
('RoleDefinition', 'ILocalRoleGenerator'),
('TradeCondition', 'ITransformation'),
('TradeModelCell', 'ITransformation'),
('TradeModelCell', 'IVariated'),
......
......@@ -544,7 +544,6 @@ class ERP5TypeInformation(XMLObject,
security.declareProtected(Permissions.ModifyPortalContent, 'deleteActions')
@deprecated
def deleteActions(self, selections=(), REQUEST=None):
# XXX Should be deprecated.
action_list = self.listActions()
self.manage_delObjects([action_list[x].id for x in selections])
......@@ -553,7 +552,7 @@ class ERP5TypeInformation(XMLObject,
def listActions(self, info=None, object=None):
""" List all the actions defined by a provider."""
return sorted(self.getActionInformationList(),
key=lambda x: x.getFloatIndex())
key=lambda x: (x.getFloatIndex(), x.getId()))
def _importOldAction(self, old_action):
from Products.ERP5Type.Document.ActionInformation import ActionInformation
......
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