Commit ae1c09f8 authored by Jérome Perrin's avatar Jérome Perrin

use getParentValue instead of getParent. remove getCausalityState workflow...

use getParentValue instead of getParent. remove getCausalityState workflow method now generated by aq_dynamic

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6515 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 876386b6
No related merge requests found
...@@ -73,16 +73,6 @@ class AppliedRule(XMLObject): ...@@ -73,16 +73,6 @@ class AppliedRule(XMLObject):
""" show the content in the left pane of the ZMI """ """ show the content in the left pane of the ZMI """
return self.objectValues() return self.objectValues()
security.declareProtected(Permissions.AccessContentsInformation, 'getCausalityState')
def getCausalityState(self, id_only=1):
"""
Returns the current state in causality
"""
portal_workflow = getToolByName(self, 'portal_workflow')
wf = portal_workflow.getWorkflowById('causality_workflow')
return wf._getWorkflowStateOf(self, id_only=id_only)
security.declareProtected(Permissions.AccessContentsInformation, 'test') security.declareProtected(Permissions.AccessContentsInformation, 'test')
def test(self): def test(self):
""" """
...@@ -124,7 +114,7 @@ class AppliedRule(XMLObject): ...@@ -124,7 +114,7 @@ class AppliedRule(XMLObject):
if rule is not None: if rule is not None:
if self.isRootAppliedRule(): if self.isRootAppliedRule():
# We should capture here a list of url/uids of deliveires to update # We should capture here a list of url/uids of deliveires to update
rule._v_notify_dict = {} rule._v_notify_dict = {}
rule.expand(self,**kw) rule.expand(self,**kw)
# XXX This part must be done with a interaction workflow is needed. # XXX This part must be done with a interaction workflow is needed.
# if self.isRootAppliedRule(): # if self.isRootAppliedRule():
...@@ -219,31 +209,35 @@ class AppliedRule(XMLObject): ...@@ -219,31 +209,35 @@ class AppliedRule(XMLObject):
result.extend(m.getMovementIndex()) result.extend(m.getMovementIndex())
return result return result
security.declareProtected(Permissions.View, 'isRootAppliedRule') security.declareProtected(Permissions.AccessContentsInformation,
'isRootAppliedRule')
def isRootAppliedRule(self): def isRootAppliedRule(self):
""" """
Returns 1 is this is a root applied rule Returns 1 is this is a root applied rule
""" """
if self.getParent().getMetaType() == "ERP5 Simulation Tool": return self.getParentValue().getMetaType() == "ERP5 Simulation Tool"
return 1
else:
return 0
security.declareProtected(Permissions.AccessContentsInformation,
'getRootAppliedRule')
def getRootAppliedRule(self): def getRootAppliedRule(self):
# Return the root applied rule -- useful if some reindexing is needed from inside """Return the root applied rule.
if self.getParent().getMetaType() == "ERP5 Simulation Tool": useful if some reindexing is needed from inside
"""
if self.getParentValue().getMetaType() == "ERP5 Simulation Tool":
return self return self
else: return self.getParentValue().getRootAppliedRule()
return self.getParent().getRootAppliedRule()
# Psyco optimizations # Psyco optimizations
psyco.bind(getMovementIndex) psyco.bind(getMovementIndex)
security.declareProtected(Permissions.ModifyPortalContent, 'notifySimulationChange') security.declareProtected(Permissions.ModifyPortalContent,
'notifySimulationChange')
def notifySimulationChange(self, notify_dict): def notifySimulationChange(self, notify_dict):
for delivery_url in notify_dict.keys(): for delivery_url in notify_dict.keys():
delivery_value = self.getPortalObject().restrictedTraverse(delivery_url) delivery_value = self.getPortalObject().restrictedTraverse(delivery_url)
if delivery_value is None: if delivery_value is None:
LOG("ERP5 WARNING", 0, 'Unable to access object %s to notify simulation change' % delivery_url) LOG("ERP5 WARNING", 0,
'Unable to access object %s to notify simulation change' %
delivery_url)
else: else:
delivery_value.notifySimulationChange() delivery_value.notifySimulationChange()
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