[Erp5-report] r27607 - /erp5/trunk/products/ERP5/Document/TradeModelLine.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jun 16 15:37:26 CEST 2009
Author: luke
Date: Tue Jun 16 15:37:22 2009
New Revision: 27607
URL: http://svn.erp5.org?rev=27607&view=rev
Log:
- simplify and document decisions for applying and checking if something new was created
Modified:
erp5/trunk/products/ERP5/Document/TradeModelLine.py
Modified: erp5/trunk/products/ERP5/Document/TradeModelLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TradeModelLine.py?rev=27607&r1=27606&r2=27607&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TradeModelLine.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TradeModelLine.py [utf8] Tue Jun 16 15:37:22 2009
@@ -192,15 +192,16 @@
# have to look on cells, if we don't, look on self)
for movement in movement_list:
if set(base_application_list)\
- .intersection(set(movement.getBaseContributionList())):
- if len(movement.getVariationCategoryList()) == 0 or \
- set(movement.getVariationCategoryList()).intersection(\
- set(tmp_movement.getVariationCategoryList())):
- # if the movement have no variation category, it's the same as
- # if he have all variation categories
- quantity = tmp_movement.getQuantity(0.0)
- modified = 1
- tmp_movement.setQuantity(quantity + movement.getTotalPrice())
+ .intersection(set(movement.getBaseContributionList())) and \
+ len(movement.getVariationCategoryList()) == 0 or \
+ set(movement.getVariationCategoryList()).intersection( \
+ set(tmp_movement.getVariationCategoryList())):
+ # at least one base application is in base contributions and
+ # if the movement have no variation category, it's the same as
+ # if he have all variation categories
+ quantity = tmp_movement.getQuantity(0.0)
+ modified = 1
+ tmp_movement.setQuantity(quantity + movement.getTotalPrice())
else:
# if the quantity is defined, we use it
modified = 1
@@ -228,8 +229,8 @@
elif model_slice_max:
tmp_movement.setQuantity(model_slice_max-model_slice_min)
- if not update:
- if modified:
- aggregated_amount_list.append(tmp_movement)
+ if not update and modified:
+ # no movements were updated, but something was modified, so new movement appeared
+ aggregated_amount_list.append(tmp_movement)
return aggregated_amount_list
More information about the Erp5-report
mailing list