[Erp5-report] r20515 - in /erp5/trunk/products/ERP5/Document: Delivery.py OrderLine.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Apr 15 10:32:35 CEST 2008
Author: jerome
Date: Tue Apr 15 10:32:35 2008
New Revision: 20515
URL: http://svn.erp5.org?rev=20515&view=rev
Log:
change fast default value in getTotalPrice / getTotalQuantity. Do not use sql
methods by default, because they return wrong result when movements are not
indexed yet.
Modified:
erp5/trunk/products/ERP5/Document/Delivery.py
erp5/trunk/products/ERP5/Document/OrderLine.py
Modified: erp5/trunk/products/ERP5/Document/Delivery.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Delivery.py?rev=20515&r1=20514&r2=20515&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Delivery.py (original)
+++ erp5/trunk/products/ERP5/Document/Delivery.py Tue Apr 15 10:32:35 2008
@@ -116,7 +116,7 @@
security.declareProtected( Permissions.AccessContentsInformation,
'getTotalPrice')
- def getTotalPrice(self, fast=1, src__=0, **kw):
+ def getTotalPrice(self, fast=0, src__=0, **kw):
""" Returns the total price for this order
if the `fast` argument is set to a true value, then it use
SQLCatalog to compute the price, otherwise it sums the total
@@ -139,7 +139,7 @@
security.declareProtected(Permissions.AccessContentsInformation,
'getTotalQuantity')
- def getTotalQuantity(self, fast=1, src__=0, **kw):
+ def getTotalQuantity(self, fast=0, src__=0, **kw):
""" Returns the total quantity of this order.
if the `fast` argument is set to a true value, then it use
SQLCatalog to compute the quantity, otherwise it sums the total
Modified: erp5/trunk/products/ERP5/Document/OrderLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/OrderLine.py?rev=20515&r1=20514&r2=20515&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/OrderLine.py (original)
+++ erp5/trunk/products/ERP5/Document/OrderLine.py Tue Apr 15 10:32:35 2008
@@ -80,11 +80,13 @@
transactional_variable[call_method_key] = result
return result
- def _getTotalPrice(self, context, fast=1):
- """
+ def _getTotalPrice(self, context, fast=0):
+ """Returns the total price for this order line.
+
if hasLineContent: return sum of lines total price
if hasCellContent: return sum of cells total price
else: return quantity * price
+ if fast is argument true, then a SQL method will be used.
"""
base_id = 'movement'
if self.hasLineContent():
@@ -104,11 +106,13 @@
security.declareProtected(Permissions.AccessContentsInformation,
'getTotalQuantity')
- def getTotalQuantity(self, fast=1):
- """
+ def getTotalQuantity(self, fast=0):
+ """Returns the total quantity of this order line.
+
if hasLineContent: return sum of lines total quantity
if hasCellContent: return sum of cells total quantity
else: return quantity
+ if fast argument is true, then a SQL method will be used.
"""
base_id = 'movement'
if self.hasLineContent():
More information about the Erp5-report
mailing list