Commit 804dd75b authored by Sebastien Robin's avatar Sebastien Robin

simulation: add a solver allowing to move quantity to another existing delivery (part 2)

Usually, the split and defer dialog suggest you to define start and stop date. So if you have
already an existing delivery and you would like it to be updated, you have to set correct start
and stop date and, if all categories are fully the same, you might have some chance to see
this delivery updated.

To improve the case where you would like to move quantity to existing delivery, add option in the
solve divergence dialog of "Move to existing Delivery" that allows you to select similar deliveries. Then
this specific solver would set correct properties for you to make sure the expected delivery would be updated.
parent 73a92b4b
......@@ -96,8 +96,6 @@ class QuantitySplitMoveSolver(QuantitySplitSolver):
# from simulation
divergence_list = delivery_to_move.getDivergenceList()
if divergence_list:
"""def _solveDivergence(self, document, property, solver, **kw):"""
"""Solve divergence by using solver tool"""
solver_process_tool = portal.portal_solver_processes
solver_process = solver_process_tool.newSolverProcess(delivery_to_move)
solver_decision, = [x for x in solver_process.contentValues()
......@@ -108,3 +106,10 @@ class QuantitySplitMoveSolver(QuantitySplitSolver):
solver_decision.updateConfiguration(tested_property_list=['quantity'])
solver_process.buildTargetSolverList()
solver_process.solve()
# Finish solving
if self.getPortalObject().portal_workflow.isTransitionPossible(
self, 'succeed'):
self.succeed()
solver_dict["new_movement_list"] = new_movement_list
return solver_dict
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