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

overload methods that does too much, we always want to set the quantity here


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40272 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 214a4d46
...@@ -137,3 +137,30 @@ class BudgetCell(Predicate, MetaNode, Movement): ...@@ -137,3 +137,30 @@ class BudgetCell(Predicate, MetaNode, Movement):
def getExplanationValue(self, default=None): def getExplanationValue(self, default=None):
"""Explanation has no meaning for a budget cell""" """Explanation has no meaning for a budget cell"""
return default return default
security.declareProtected(Permissions.ModifyPortalContent,
'setSourceCredit')
def setSourceCredit(self, source_credit):
"""Set the quantity.
Overloaded from movement, we always set the quantity, if not passed
"""
try:
source_credit = float(source_credit)
except TypeError:
source_credit = 0.0
self.setQuantity(source_credit)
def setSourceDebit(self, source_debit):
"""Set the quantity.
Overloaded from movement, we always set the quantity, if not passed
"""
try:
source_debit = float(source_debit)
except TypeError:
source_debit = 0.0
self.setQuantity(source_debit)
security.declareProtected( Permissions.ModifyPortalContent,
'setDestinationDebit', 'setDestinationCredit' )
setDestinationDebit = setSourceCredit
setDestinationCredit = setSourceDebit
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