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

Support Cancellation Amount in Budget Cell

parent f0529181
......@@ -143,23 +143,23 @@ class BudgetCell(Predicate, MetaNode, Movement):
'setSourceCredit')
def setSourceCredit(self, source_credit):
"""Set the quantity.
Overloaded from movement, we always set the quantity, if not passed
Overloaded from movement, we always set the quantity, even if not passed
"""
try:
source_credit = float(source_credit)
except TypeError:
source_credit = 0.0
self.setQuantity(source_credit)
Movement.setSourceCredit(self, source_credit)
def setSourceDebit(self, source_debit):
"""Set the quantity.
Overloaded from movement, we always set the quantity, if not passed
Overloaded from movement, we always set the quantity, even if not passed
"""
try:
source_debit = float(source_debit)
except TypeError:
source_debit = 0.0
self.setQuantity(-source_debit)
Movement.setSourceDebit(self, source_debit)
security.declareProtected( Permissions.ModifyPortalContent,
'setDestinationDebit', 'setDestinationCredit' )
......
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