Commit 6319df45 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

if 'movement' that is passed to solver is a delivery (eg. in case of...

if 'movement' that is passed to solver is a delivery (eg. in case of start_date divergence), we need to find related simulation movements by its movements.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31484 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c06ff199
......@@ -67,7 +67,14 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject):
solved_property = self._getPortalTypeValue().getTestedProperty()
for movement in self.getDeliveryValueList():
new_value = movement.getProperty(solved_property)
for simulation_movement in movement.getDeliveryRelatedValueList():
simulation_movement_list = movement.getDeliveryRelatedValueList()
# if movement here is a delivery, we need to find simulation
# movements by its movements.
if len(simulation_movement_list) == 0:
simulation_movement_list = sum(
[x.getDeliveryRelatedValueList() \
for x in self.getDeliveryValue().getMovementList()], [])
for simulation_movement in simulation_movement_list:
if not simulation_movement.isPropertyRecorded(solved_property):
simulation_movement.recordProperty(solved_property)
# XXX hard coded
......
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