[Erp5-report] r33632 yusei - in /erp5/trunk/products/ERP5/Document: Order.py TradeCondition.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 11 12:42:21 CET 2010


Author: yusei
Date: Thu Mar 11 12:42:20 2010
New Revision: 33632

URL: http://svn.erp5.org?rev=33632&view=rev
Log:
Add force_create_line parameter to TradeCondition.getAggregatedAmountList.

Modified:
    erp5/trunk/products/ERP5/Document/Order.py
    erp5/trunk/products/ERP5/Document/TradeCondition.py

Modified: erp5/trunk/products/ERP5/Document/Order.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Order.py?rev=33632&r1=33631&r2=33632&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Order.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Order.py [utf8] Thu Mar 11 12:42:20 2010
@@ -96,7 +96,7 @@
         if not base_contribution_value_list:
           # We cannot find any amount so that the result is 0.
           return 0
-        current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding)
+        current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding, force_create_line=True)
         trade_model_line = newTempTradeModelLine(
             self,
             '_temp_%s' % (self.getId()))

Modified: erp5/trunk/products/ERP5/Document/TradeCondition.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TradeCondition.py?rev=33632&r1=33631&r2=33632&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TradeCondition.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TradeCondition.py [utf8] Thu Mar 11 12:42:20 2010
@@ -260,7 +260,8 @@
 
     security.declareProtected(Permissions.AccessContentsInformation,
                               'getAggregatedAmountList')
-    def getAggregatedAmountList(self, context, movement_list=None, **kw):
+    def getAggregatedAmountList(self, context, movement_list=None,
+                                force_create_line=False, **kw):
       if movement_list is None:
         movement_list = []
       result = AggregatedAmountList()
@@ -290,7 +291,7 @@
                 'Reference must be set.')
         for model_line in trade_model_line_composed_list:
           if model_line.getReference() == movement_reference and\
-              model_line.isCreateLine():
+              (force_create_line or model_line.isCreateLine()):
             aggregated_amount_list.append(movement)
 
       return aggregated_amount_list




More information about the Erp5-report mailing list