Fix AdoptSolver. A movement could have more than one related Simulation...

Fix AdoptSolver. A movement could have more than one related Simulation Movement, and the one returned by getDeliveryRelatedValue() might not be the one that is divergent. It could be not even a Simulation Movement at all!

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44568 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ed086b7
......@@ -95,9 +95,18 @@ class AdoptSolver(SolverMixin, ConfigurableMixin, XMLObject):
else:
# XXX TODO we need to support multiple values for categories or
# list type property.
simulation_movement = movement.getDeliveryRelatedValue()
movement.setProperty(solved_property,
simulation_movement.getProperty(solved_property))
# XXX-Leo: If there is more than one simulation_movement in
# the simulation_movement_list, this indicates a wrong
# configuration or bad selection by the user. Should we do
# anything about it, like log or fail?
# Also, the behaviour below is naive, and could cause another
# non-divergent Simulation Movement to become divergent.
for simulation_movement in simulation_movement_list:
movement.setProperty(
solved_property,
simulation_movement.getProperty(solved_property)
)
# Finish solving
if self.getPortalObject().portal_workflow.isTransitionPossible(
self, 'succeed'):
......
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