[Erp5-report] r31368 kazuhiko - /erp5/trunk/products/ERP5/Tool/SolverTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Dec 17 10:37:32 CET 2009


Author: kazuhiko
Date: Thu Dec 17 10:37:30 2009
New Revision: 31368

URL: http://svn.erp5.org?rev=31368&view=rev
Log:
implement SolverTool.getSolverDecisionApplicationValueList() in "Short Term Implementation Approach".

Modified:
    erp5/trunk/products/ERP5/Tool/SolverTool.py

Modified: erp5/trunk/products/ERP5/Tool/SolverTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/SolverTool.py?rev=31368&r1=31367&r2=31368&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/SolverTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/SolverTool.py [utf8] Thu Dec 17 10:37:30 2009
@@ -196,18 +196,22 @@
     of the interface definition.
     """
     # Short Term Implementation Approach
+    test_property = divergence_tester.getTestedProperty()
+    application_value = movement
+    try:
+      while not application_value.hasProperty(test_property):
+        application_value = application_value.getParentValue()
+    except AttributeError:
+      # if missing, it should be in Delivery level ?
+      application_value = movement.getDeliveryValue()
+    return [application_value]
+
+    # Alternate short Term Implementation Approach
     return self.SolverTool_getSolverDecisionApplicationValueList(movement, divergence_tester)
 
     # Alternate short Term Implementation Approach
     return divergence_tester.getTypeBasedMethod('getSolverDecisionApplicationValueList')( 
                                                 movement, divergence_tester)
-
-    # Alternate short Term Implementation Approach
-    test_property = divergence_tester.getTestedProperty()
-    application_value = movement
-    while not application_value.hasProperty(test_property):
-      application_value = application_value.getParentValue()
-    return application_value
 
     # Mid-term implementation (we suppose movement is a delivery)
     # use delivery builders to find out at which level the given




More information about the Erp5-report mailing list