[Erp5-report] r36566 nicolas.dumazet - /erp5/trunk/products/ERP5/Document/BusinessPath.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jun 24 05:22:33 CEST 2010


Author: nicolas.dumazet
Date: Thu Jun 24 05:22:31 2010
New Revision: 36566

URL: http://svn.erp5.org?rev=36566&view=rev
Log:
if all simulation movements are delivered, no need to check further

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

Modified: erp5/trunk/products/ERP5/Document/BusinessPath.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessPath.py?rev=36566&r1=36565&r2=36566&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] Thu Jun 24 05:22:31 2010
@@ -227,19 +227,22 @@ class BusinessPath(Path, Predicate):
   def isBuildable(self, explanation):
     """
     """
-    # check if there is at least one simulation movement which is not
-    # delivered
-    result = False
     if self.isCompleted(explanation) or self.isFrozen(explanation):
       return False # No need to build what was already built or frozen
+
+    # check if there is at least one simulation movement which is not
+    # delivered
     for simulation_movement in self.getRelatedSimulationMovementValueList(
         explanation):
       if simulation_movement.getDeliveryValue() is None:
-        result = True
         break
+    else:
+      # if all simulation movements are delivered, we can bail out
+      return False
+
     predecessor = self.getPredecessorValue()
     if predecessor is None:
-      return result
+      return True
     # XXX FIXME TODO
     # For now isPartiallyCompleted is used, as it was
     # assumed to not implement isPartiallyBuildable, so in reality
@@ -250,9 +253,7 @@ class BusinessPath(Path, Predicate):
     #
     # Such cases are Business Processes using sequence not related
     # to simulation tree with much of compensations
-    if predecessor.isPartiallyCompleted(explanation):
-      return result
-    return False
+    return predecessor.isPartiallyCompleted(explanation)
 
   def isPartiallyBuildable(self, explanation):
     """




More information about the Erp5-report mailing list