Commit 86900595 authored by Aurel's avatar Aurel

CashDelivery can redefine getBaobabSource/DEstination with script and

line must acquire it from document


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7633 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 99eaec1e
...@@ -60,3 +60,22 @@ class CashDelivery(BankingOperation): ...@@ -60,3 +60,22 @@ class CashDelivery(BankingOperation):
, PropertySheet.ItemAggregation , 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()
...@@ -75,7 +75,7 @@ class CashDeliveryLine(BaobabMixin, DeliveryLine): ...@@ -75,7 +75,7 @@ class CashDeliveryLine(BaobabMixin, DeliveryLine):
script = self._getTypeBasedMethod('getBaobabSource') script = self._getTypeBasedMethod('getBaobabSource')
if script is not None: if script is not None:
return script(self) return script(self)
return self.getSource() return self.aq_parent.getBaobabSource(**kw)
security.declareProtected(Permissions.View, 'getBaobabDestination') security.declareProtected(Permissions.View, 'getBaobabDestination')
def getBaobabDestination(self): def getBaobabDestination(self):
...@@ -85,7 +85,7 @@ class CashDeliveryLine(BaobabMixin, DeliveryLine): ...@@ -85,7 +85,7 @@ class CashDeliveryLine(BaobabMixin, DeliveryLine):
script = self._getTypeBasedMethod('getBaobabDestination') script = self._getTypeBasedMethod('getBaobabDestination')
if script is not None: if script is not None:
return script(self) return script(self)
return self.getDestination() return self.aq_parent.getBaobabDestination(**kw)
security.declareProtected(Permissions.View, 'getBaobabSourceVariationText') security.declareProtected(Permissions.View, 'getBaobabSourceVariationText')
def getBaobabSourceVariationText(self): def getBaobabSourceVariationText(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