Commit 3738dc1c authored by Aurel's avatar Aurel

allow to return list of new movements when doing solveMovement


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4421 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4eded19e
...@@ -89,8 +89,10 @@ class TargetSolver: ...@@ -89,8 +89,10 @@ class TargetSolver:
# apply to all movements # apply to all movements
simulation_movement_list = movement.getDeliveryRelatedValueList( simulation_movement_list = movement.getDeliveryRelatedValueList(
portal_type="Simulation Movement") portal_type="Simulation Movement")
solved_movement_list = []
for simulation_movement in simulation_movement_list: for simulation_movement in simulation_movement_list:
self.solve(simulation_movement) solved_movement_list.append(self.solve(simulation_movement))
return solved_movement_list
def close(self): def close(self):
""" """
......
...@@ -117,7 +117,7 @@ class SimulationTool (BaseTool): ...@@ -117,7 +117,7 @@ class SimulationTool (BaseTool):
""" """
Solve a movement by calling DeliverySolver and TargetSolver Solve a movement by calling DeliverySolver and TargetSolver
""" """
self.solveMovementOrDelivery(movement, dsolver_name, tsolver_name, return self.solveMovementOrDelivery(movement, dsolver_name, tsolver_name,
movement=1,additional_parameters=additional_parameters,**kw) movement=1,additional_parameters=additional_parameters,**kw)
def solveMovementOrDelivery(self, obj, dsolver_name, tsolver_name, def solveMovementOrDelivery(self, obj, dsolver_name, tsolver_name,
...@@ -138,9 +138,9 @@ class SimulationTool (BaseTool): ...@@ -138,9 +138,9 @@ class SimulationTool (BaseTool):
solver = solver_class(additional_parameters=additional_parameters,**kw) solver = solver_class(additional_parameters=additional_parameters,**kw)
if movement: if movement:
solver.solveMovement(obj) return solver.solveMovement(obj)
if delivery: if delivery:
solver.solveDelivery(obj) return solver.solveDelivery(obj)
####################################################### #######################################################
# Stock Management # Stock Management
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment