[Erp5-report] r27692 - /erp5/trunk/products/ERP5/Document/TradeCondition.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jun 19 17:56:31 CEST 2009


Author: fabien
Date: Fri Jun 19 17:56:29 2009
New Revision: 27692

URL: http://svn.erp5.org?rev=27692&view=rev
Log:
the way to remove movement that should not be created was wrong. Using the reference of movement to find corresponding model_line and remove the movements of the model lines that should not be created is better.

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

Modified: erp5/trunk/products/ERP5/Document/TradeCondition.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TradeCondition.py?rev=27692&r1=27691&r2=27692&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TradeCondition.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TradeCondition.py [utf8] Fri Jun 19 17:56:29 2009
@@ -232,14 +232,21 @@
             movement_list=movement_list,
             current_aggregated_amount_list=result,
             **kw)
-          if model_line.getCreateLine():
-            # remove movement that should not be created
-            result.extend(model_line_result)
+          result.extend(model_line_result)
         if len(result) != len(movement_list):
           # something was added
           need_to_run = 1
           movement_list = result
-      return result
+
+      # remove movement that should not be created
+      movement_list = []
+      for movement in result:
+        movement_ref = movement.getReference()
+        for model_line in trade_model_line_composed_list:
+          if model_line.getReference() == movement_ref and\
+              model_line.isCreateLine():
+            movement_list.append(movement)
+      return movement_list
 
     security.declareProtected( Permissions.AccessContentsInformation, 'getCell')
     def getCell(self, *kw , **kwd):




More information about the Erp5-report mailing list