[Erp5-report] r27263 - /erp5/trunk/products/ERP5/Document/TradeModelCell.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 29 17:32:13 CEST 2009


Author: fabien
Date: Fri May 29 17:32:12 2009
New Revision: 27263

URL: http://svn.erp5.org?rev=27263&view=rev
Log:
add getPrice and getTotalPrice method. Inheritate from TradeModelLine.

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

Modified: erp5/trunk/products/ERP5/Document/TradeModelCell.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TradeModelCell.py?rev=27263&r1=27262&r2=27263&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TradeModelCell.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TradeModelCell.py [utf8] Fri May 29 17:32:12 2009
@@ -31,12 +31,12 @@
 
 from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
 
-from Products.ERP5.Document.Amount import Amount
+from Products.ERP5.Document.TradeModelLine import TradeModelLine
 from Products.ERP5.Document.MappedValue import MappedValue
 
 import zope.interface
 
-class TradeModelCell(Amount, MappedValue):
+class TradeModelCell(TradeModelLine, MappedValue):
     """Trade Model Line
     """
     meta_type = 'ERP5 Trade Model Cell'
@@ -78,4 +78,17 @@
         current_aggregated_amount_list = None, **kw):
       raise NotImplementedError('TODO')
 
+    security.declareProtected(Permissions.AccessContentsInformation,
+                              'getPrice')
+    def getPrice(self):
+      return self._baseGetPrice()
 
+    security.declareProtected(Permissions.AccessContentsInformation,
+                              'getTotalPrice')
+    def getTotalPrice(self):
+      """
+        Returns the totals price for this line
+      """
+      quantity = self.getQuantity() or 0.0
+      price = self.getPrice() or 0.0
+      return quantity * price




More information about the Erp5-report mailing list