[Erp5-report] r7633 - /erp5/trunk/products/ERP5Banking/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 7 12:15:38 CEST 2006


Author: aurel
Date: Wed Jun  7 12:15:36 2006
New Revision: 7633

URL: http://svn.erp5.org?rev=7633&view=rev
Log:
CashDelivery can redefine getBaobabSource/DEstination with script and
line must acquire it from document

Modified:
    erp5/trunk/products/ERP5Banking/Document/CashDelivery.py
    erp5/trunk/products/ERP5Banking/Document/CashDeliveryLine.py

Modified: erp5/trunk/products/ERP5Banking/Document/CashDelivery.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/Document/CashDelivery.py?rev=7633&r1=7632&r2=7633&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/Document/CashDelivery.py (original)
+++ erp5/trunk/products/ERP5Banking/Document/CashDelivery.py Wed Jun  7 12:15:36 2006
@@ -60,3 +60,22 @@
                     , PropertySheet.ItemAggregation
                     )
 
+  security.declareProtected(Permissions.View, 'getBaobabSource')
+  def getBaobabSource(self):
+    """
+      Returns a calculated source
+    """
+    script = self._getTypeBasedMethod('getBaobabSource')
+    if script is not None:
+      return script(self)      
+    return self.getSource()
+
+  security.declareProtected(Permissions.View, 'getBaobabDestination')
+  def getBaobabDestination(self):
+    """
+      Returns a calculated destination
+    """
+    script = self._getTypeBasedMethod('getBaobabDestination')
+    if script is not None:
+      return script(self)
+    return self.getDestination()

Modified: erp5/trunk/products/ERP5Banking/Document/CashDeliveryLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/Document/CashDeliveryLine.py?rev=7633&r1=7632&r2=7633&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/Document/CashDeliveryLine.py (original)
+++ erp5/trunk/products/ERP5Banking/Document/CashDeliveryLine.py Wed Jun  7 12:15:36 2006
@@ -74,8 +74,8 @@
     """
     script = self._getTypeBasedMethod('getBaobabSource')
     if script is not None:
-      return script(self)      
-    return self.getSource()
+      return script(self)
+    return self.aq_parent.getBaobabSource(**kw)
 
   security.declareProtected(Permissions.View, 'getBaobabDestination')
   def getBaobabDestination(self):
@@ -85,7 +85,7 @@
     script = self._getTypeBasedMethod('getBaobabDestination')
     if script is not None:
       return script(self)
-    return self.getDestination()
+    return self.aq_parent.getBaobabDestination(**kw)
 
   security.declareProtected(Permissions.View, 'getBaobabSourceVariationText')
   def getBaobabSourceVariationText(self):




More information about the Erp5-report mailing list