[Erp5-report] r20350 - /erp5/trunk/products/ERP5/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 8 15:00:04 CEST 2008


Author: jerome
Date: Tue Apr  8 15:00:04 2008
New Revision: 20350

URL: http://svn.erp5.org?rev=20350&view=rev
Log:
getExplanation* will use getExplanationValue, this way movements with a specific behaviour on explanation only have to override getExplanationValue


Modified:
    erp5/trunk/products/ERP5/Document/Event.py
    erp5/trunk/products/ERP5/Document/Movement.py
    erp5/trunk/products/ERP5/Document/SimulationMovement.py

Modified: erp5/trunk/products/ERP5/Document/Event.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Event.py?rev=20350&r1=20349&r2=20350&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Event.py (original)
+++ erp5/trunk/products/ERP5/Document/Event.py Tue Apr  8 15:00:04 2008
@@ -94,20 +94,6 @@
       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,
                                'getExplanationValue')
     def getExplanationValue(self):
       """An event is it's own explanation

Modified: erp5/trunk/products/ERP5/Document/Movement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Movement.py?rev=20350&r1=20349&r2=20350&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Movement.py (original)
+++ erp5/trunk/products/ERP5/Document/Movement.py Tue Apr  8 15:00:04 2008
@@ -492,7 +492,9 @@
     """
       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,
                              'getExplanationUid')
@@ -500,7 +502,9 @@
     """
       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,
                              'getExplanationValue')

Modified: erp5/trunk/products/ERP5/Document/SimulationMovement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SimulationMovement.py?rev=20350&r1=20349&r2=20350&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SimulationMovement.py (original)
+++ erp5/trunk/products/ERP5/Document/SimulationMovement.py Tue Apr  8 15:00:04 2008
@@ -275,26 +275,6 @@
     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,
                              'getExplanationValue')
   def getExplanationValue(self):
     """Returns the delivery if any or the order related to the root




More information about the Erp5-report mailing list