diff --git a/product/ERP5/Document/SolverProcess.py b/product/ERP5/Document/SolverProcess.py index d52ef01ad3da5720c8f7880b926f70c07d2cd53e..3600772cc162848c26f05d8cea36ee9981971eaa 100644 --- a/product/ERP5/Document/SolverProcess.py +++ b/product/ERP5/Document/SolverProcess.py @@ -192,8 +192,7 @@ class SolverProcess(XMLObject, ActiveProcess): this helps reducing CPU time. """ - def buildSolverDecisionList(self, delivery_or_movement=None, - temp_object=False): + def buildSolverDecisionList(self, delivery_or_movement=None): """ Build (or rebuild) the solver decisions in the solver process @@ -239,7 +238,6 @@ class SolverProcess(XMLObject, ActiveProcess): # Now build the solver decision instances based on the previous # grouping solver_decision_list = self.objectValues(portal_type='Solver Decision') - index = 1 for solver_decision_key, movement_dict in solver_decision_dict.items(): causality, delivery_list, solver_list = solver_decision_key matched_solver_decision_list = [ @@ -249,14 +247,7 @@ class SolverProcess(XMLObject, ActiveProcess): if len(matched_solver_decision_list) > 0: solver_decision_list.remove(matched_solver_decision_list[0]) else: - if temp_object: - new_decision = self.newContent(portal_type='Solver Decision', - temp_object=True, - #id=index, - uid='new_%s' % index) - index += 1 - else: - new_decision = self.newContent(portal_type='Solver Decision') + new_decision = self.newContent(portal_type='Solver Decision') new_decision._setDeliveryValueList(movement_dict.keys()) new_decision._setCausality(solver_decision_key[0]) # If we have only one available automatic solver, we just use it diff --git a/product/ERP5/Tool/SolverProcessTool.py b/product/ERP5/Tool/SolverProcessTool.py index 4665486e464d068cdd79d3ef11f4bb30bee057c0..9fc73e1707f57b82cf7a9e8a94264ac511e716c7 100644 --- a/product/ERP5/Tool/SolverProcessTool.py +++ b/product/ERP5/Tool/SolverProcessTool.py @@ -92,8 +92,7 @@ class SolverProcessTool(BaseTool): new_solver = self.newContent(portal_type='Solver Process', temp_object=temp_object) # And build decisions - new_solver.buildSolverDecisionList(delivery_or_movement=delivery_or_movement, - temp_object=temp_object) + new_solver.buildSolverDecisionList(delivery_or_movement) if not temp_object: # Append the solver process into the delivery's solver category @@ -104,4 +103,5 @@ class SolverProcessTool(BaseTool): solver_list = delivery.getSolverValueList() solver_list.append(new_solver) delivery.setSolverValueList(solver_list) - return new_solver + + return new_solver