Commit fcd8cb1e authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

revert r35858 and r35859, that requires more discussion.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35864 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d34c515b
......@@ -707,7 +707,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, CompositionMixin):
# only expand if we are not in a "too early" or "too late" state
if (self.getSimulationState() in
self.getGroupedStateList('draft_order')):
self.getPortalDraftOrderStateList()):
return
portal_rules = getToolByName(self, 'portal_rules')
......
......@@ -3801,41 +3801,6 @@ class Base( CopyContainer,
def isItem(self):
return self.portal_type in self.getPortalItemTypeList()
security.declareProtected(Permissions.AccessContentsInformation,
'getGroupedStateList')
def getGroupedStateList(self, group):
"""
Return a list of workflow states classified to a specific group.
"""
portal_type = self.getPortalType()
def getStateList(portal_type, group):
state_dict = {}
portal_workflow = self.getPortalObject().portal_workflow
wf_id_list = portal_workflow.getChainFor(portal_type)
for wf_id in wf_id_list:
states = getattr(portal_workflow[wf_id], 'states', None)
if states is not None:
for state in states.objectValues():
if group in getattr(state, 'type_list', ()):
state_dict[state.getId()] = None
return tuple(state_dict.keys())
getStateList = CachingMethod(
getStateList,
id=('_getPortalGroupedStateList', portal_type, group),
cache_factory='erp5_content_medium')
state_list = getStateList(portal_type, group)
if len(state_list) == 0:
# If we cannot get state list from this portal type's workflow
# chain, try to get from the portal.
portal = self.getPortalObject()
state_list = portal._getPortalGroupedStateList(group) or \
portal._getPortalConfiguration('portal_%s_state_list' % group)
return state_list
InitializeClass(Base)
try:
......
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