[Erp5-report] r40272 jerome - /erp5/trunk/products/ERP5/Document/BudgetCell.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Nov 15 15:06:28 CET 2010


Author: jerome
Date: Mon Nov 15 15:06:28 2010
New Revision: 40272

URL: http://svn.erp5.org?rev=40272&view=rev
Log:
overload methods that does too much, we always want to set the quantity here

Modified:
    erp5/trunk/products/ERP5/Document/BudgetCell.py

Modified: erp5/trunk/products/ERP5/Document/BudgetCell.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BudgetCell.py?rev=40272&r1=40271&r2=40272&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BudgetCell.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BudgetCell.py [utf8] Mon Nov 15 15:06:28 2010
@@ -137,3 +137,30 @@ class BudgetCell(Predicate, MetaNode, Mo
     def getExplanationValue(self, default=None):
       """Explanation has no meaning for a budget cell"""
       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




More information about the Erp5-report mailing list