[Erp5-report] r33687 tatuya - /erp5/trunk/products/ERP5/MovementGroup.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 12 09:52:38 CET 2010


Author: tatuya
Date: Fri Mar 12 09:52:36 2010
New Revision: 33687

URL: http://svn.erp5.org?rev=33687&view=rev
Log:
Fix the issue that when the sign of a quantity is negative, getAveragePrice method returns always 0.0. It will cause a problem, for example in an accounting transaction line. (approved by kazuhiko)

Modified:
    erp5/trunk/products/ERP5/MovementGroup.py

Modified: erp5/trunk/products/ERP5/MovementGroup.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/MovementGroup.py?rev=33687&r1=33686&r2=33687&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/MovementGroup.py [utf8] (original)
+++ erp5/trunk/products/ERP5/MovementGroup.py [utf8] Fri Mar 12 09:52:36 2010
@@ -398,7 +398,7 @@
       Return average price
     """
     total_quantity = self.getAddQuantity()
-    if total_quantity > 0:
+    if total_quantity != 0:
       return (self.getAddPrice() / total_quantity)
     return 0.0
 




More information about the Erp5-report mailing list