[Erp5-report] r18595 - /erp5/trunk/products/ERP5/Document/PaySheetTransaction.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 4 13:38:15 CET 2008


Author: fabien
Date: Fri Jan  4 13:38:15 2008
New Revision: 18595

URL: http://svn.erp5.org?rev=18595&view=rev
Log:
add a condition to not add the cell if it's quantity is None or null

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

Modified: erp5/trunk/products/ERP5/Document/PaySheetTransaction.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PaySheetTransaction.py?rev=18595&r1=18594&r2=18595&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PaySheetTransaction.py (original)
+++ erp5/trunk/products/ERP5/Document/PaySheetTransaction.py Fri Jan  4 13:38:15 2008
@@ -487,24 +487,25 @@
         quantity = cell_dict['quantity']
         price = cell_dict['price']
 
-        cell_list.append(cell_dict)
-
-        # update the base_participation
-        base_participation_list = service.getBaseAmountList(base=1)
-        for base_participation in base_participation_list:
-          if quantity:
-            if base_amount_dict.has_key(base_participation) and \
-                base_amount_dict[base_participation].has_key(share):
-              old_val = base_amount_dict[base_participation][share]
-            else:
-              old_val = 0
-            new_val = old_val + quantity
-            if not base_amount_dict.has_key(base_participation):
-              base_amount_dict[base_participation]={}
-
-            if price:
-              new_val = round((old_val + quantity*price), precision) 
-            base_amount_dict[base_participation][share] = new_val
+        if quantity:
+          cell_list.append(cell_dict)
+
+          # update the base_participation
+          base_participation_list = service.getBaseAmountList(base=1)
+          for base_participation in base_participation_list:
+            if quantity:
+              if base_amount_dict.has_key(base_participation) and \
+                  base_amount_dict[base_participation].has_key(share):
+                old_val = base_amount_dict[base_participation][share]
+              else:
+                old_val = 0
+              new_val = old_val + quantity
+              if not base_amount_dict.has_key(base_participation):
+                base_amount_dict[base_participation]={}
+
+              if price:
+                new_val = round((old_val + quantity*price), precision) 
+              base_amount_dict[base_participation][share] = new_val
 
       if cell_list:
         # create the PaySheetLine
@@ -558,7 +559,7 @@
       id_list = model_reference_dict[key]
       model = self.getPortalObject().restrictedTraverse(key)
       if model is None:
-        LOG("copyInheritanceSubObjects,", 0, "can't find model %s" % key)
+        LOG("getInheritedObjectValueList :", 0, "can't find model %s" % key)
 
       for id in id_list:
         object = model._getOb(id)




More information about the Erp5-report mailing list