diff --git a/product/ERP5/Document/Event.py b/product/ERP5/Document/Event.py index 89712c19cb72897d08d89250190b7dd0121ec175..4e08ba5e43d932fc50a45d66395f1d842b99f381 100755 --- a/product/ERP5/Document/Event.py +++ b/product/ERP5/Document/Event.py @@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5.Document.Document import Document +from Products.CMFCore.utils import getToolByName class Event(Document): """ @@ -104,3 +105,11 @@ an event.""" ) } + security.declareProtected(Permissions.AccessContentsInformation, 'getSimulationState') + def getEventState(self, id_only=1): + """ + Returns the current state in simulation + """ + portal_workflow = getToolByName(self, 'portal_workflow') + wf = portal_workflow.getWorkflowById('event_workflow') + return wf._getWorkflowStateOf(self, id_only=id_only )