Commit 86507f70 authored by Jérome Perrin's avatar Jérome Perrin

getExplanation* will use getExplanationValue, this way movements with a...

getExplanation* will use getExplanationValue, this way movements with a specific behaviour on explanation only have to override getExplanationValue



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20350 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5e7b6cde
...@@ -93,20 +93,6 @@ class Event(EmailDocument, Movement): ...@@ -93,20 +93,6 @@ class Event(EmailDocument, Movement):
# Provide opportunity to script this # Provide opportunity to script this
return 1. return 1.
security.declareProtected(Permissions.AccessContentsInformation,
'getExplanation')
def getExplanation(self):
"""An event is it's own explanation
"""
return self.getRelativeUrl()
security.declareProtected(Permissions.AccessContentsInformation,
'getExplanationUid')
def getExplanationUid(self):
"""An event is it's own explanation
"""
return self.getUid()
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getExplanationValue') 'getExplanationValue')
def getExplanationValue(self): def getExplanationValue(self):
......
...@@ -492,7 +492,9 @@ class Movement(XMLObject, Amount): ...@@ -492,7 +492,9 @@ class Movement(XMLObject, Amount):
""" """
Returns the relative_url of the explanation of this movement. Returns the relative_url of the explanation of this movement.
""" """
return self.getDelivery() explanation = self.getExplanationValue()
if explanation is not None:
return explanation.getRelativeUrl()
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getExplanationUid') 'getExplanationUid')
...@@ -500,7 +502,9 @@ class Movement(XMLObject, Amount): ...@@ -500,7 +502,9 @@ class Movement(XMLObject, Amount):
""" """
Returns the uid of the explanation of this movement. Returns the uid of the explanation of this movement.
""" """
return self.getDeliveryUid() explanation = self.getExplanationValue()
if explanation is not None:
return explanation.getUid()
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getExplanationValue') 'getExplanationValue')
......
...@@ -274,26 +274,6 @@ class SimulationMovement(Movement): ...@@ -274,26 +274,6 @@ class SimulationMovement(Movement):
""" """
self.setCausalityState('diverged') self.setCausalityState('diverged')
security.declareProtected( Permissions.AccessContentsInformation,
'getExplanation')
def getExplanation(self):
"""Returns the delivery's relative_url if any or the order's
relative_url related to the root applied rule if any.
"""
explanation_value = self.getExplanationValue()
if explanation_value is not None :
return explanation_value.getRelativeUrl()
security.declareProtected( Permissions.AccessContentsInformation,
'getExplanationUid')
def getExplanationUid(self):
"""Returns the delivery's uid if any or the order's uid related to
the root applied rule if any.
"""
explanation_value = self.getExplanationValue()
if explanation_value is not None :
return explanation_value.getUid()
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getExplanationValue') 'getExplanationValue')
def getExplanationValue(self): def getExplanationValue(self):
......
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