Commit 61ced2da authored by Sebastien Robin's avatar Sebastien Robin

erp5_simulation: split and move solver now working when there is several lines in delivery

The code was assuming that we could have only one quantity divergency per
delivery. So improve to support multiple divergencies.
parent 33c88781
...@@ -104,14 +104,14 @@ class QuantitySplitMoveSolver(QuantitySplitSolver): ...@@ -104,14 +104,14 @@ class QuantitySplitMoveSolver(QuantitySplitSolver):
if divergence_list: if divergence_list:
solver_process_tool = portal.portal_solver_processes solver_process_tool = portal.portal_solver_processes
solver_process = solver_process_tool.newSolverProcess(delivery_to_move) solver_process = solver_process_tool.newSolverProcess(delivery_to_move)
solver_decision, = [x for x in solver_process.contentValues() for solver_decision in [x for x in solver_process.contentValues() \
if x.getCausalityValue().getTestedProperty() == "quantity"] if x.getCausalityValue().getTestedProperty() == "quantity"]:
# use Quantity Accept Solver. # use Quantity Accept Solver.
solver_decision.setSolverValue(portal.portal_solvers['Adopt Solver']) solver_decision.setSolverValue(portal.portal_solvers['Adopt Solver'])
# configure for Accept Solver. # configure for Accept Solver.
solver_decision.updateConfiguration(tested_property_list=['quantity']) solver_decision.updateConfiguration(tested_property_list=['quantity'])
solver_process.buildTargetSolverList() solver_process.buildTargetSolverList()
solver_process.solve() solver_process.solve()
# Finish solving # Finish solving
if self.getPortalObject().portal_workflow.isTransitionPossible( if self.getPortalObject().portal_workflow.isTransitionPossible(
......
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