[Erp5-report] r33520 kazuhiko - /erp5/trunk/products/ERP5/Document/TradeModelLine.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 9 11:04:02 CET 2010


Author: kazuhiko
Date: Tue Mar  9 11:03:59 2010
New Revision: 33520

URL: http://svn.erp5.org?rev=33520&view=rev
Log:
sometimes we want to refer trade model line itself in the calculation script.
ideally, the context for the script should be the trade model line here, but unfortunately it is the passed context (i.e. a simulation movement).

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=33520&r1=33519&r2=33520&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TradeModelLine.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TradeModelLine.py [utf8] Tue Mar  9 11:03:59 2010
@@ -343,11 +343,18 @@
           tmp_movement = calculation_script(
               current_aggregated_amount_list=movement_list,
               current_movement=tmp_movement)
+        elif calculation_script.func_code.co_argcount==3:
+          # backward compatibility
+          tmp_movement = calculation_script(
+              current_aggregated_amount_list=movement_list,
+              current_movement=tmp_movement,
+              aggregated_movement_list=aggregated_movement_list)
         else:
           tmp_movement = calculation_script(
               current_aggregated_amount_list=movement_list,
               current_movement=tmp_movement,
-              aggregated_movement_list=aggregated_movement_list)
+              aggregated_movement_list=aggregated_movement_list,
+              trade_model_line=self)
         if tmp_movement is None:
           # Do nothing
           return aggregated_amount_list




More information about the Erp5-report mailing list