Commit 7f89d52b authored by Fabrice Decroix's avatar Fabrice Decroix

Add method to call the getEngagedBudget script


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23889 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9a330c99
...@@ -122,3 +122,18 @@ class BudgetCell(Predicate, MetaNode): ...@@ -122,3 +122,18 @@ class BudgetCell(Predicate, MetaNode):
Return available budget. Return available budget.
""" """
return self.getCurrentBalance() - self.getConsumedBudget() return self.getCurrentBalance() - self.getConsumedBudget()
security.declareProtected(Permissions.View, 'getEngagedBudget')
def getEngagedBudget(self, src__=0):
"""
Return Engaged budget.
"""
script = self._getTypeBasedMethod('getEngagedBudget')
try:
result = script(src__=src__)
except UnboundLocalError:
raise UnboundLocalError,\
"Did not find engaged budget script for portal type: %r" % \
self.getPortalType()
return result
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