Commit c85e0c5f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

when we adopt prevision, we need to clear recorded property on all child simulation movements.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31872 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e0ee2a1
...@@ -78,11 +78,23 @@ class AdoptSolver(SolverMixin, ConfigurableMixin, XMLObject): ...@@ -78,11 +78,23 @@ class AdoptSolver(SolverMixin, ConfigurableMixin, XMLObject):
delivery_error = total_quantity * delivery_ratio - quantity delivery_error = total_quantity * delivery_ratio - quantity
simulation_movement.edit(delivery_ratio=delivery_ratio, simulation_movement.edit(delivery_ratio=delivery_ratio,
delivery_error=delivery_error) delivery_error=delivery_error)
self._clearRecordedPropertyRecursively(simulation_movement,
solved_property)
else: else:
# XXX TODO we need to support multiple values for categories or # XXX TODO we need to support multiple values for categories or
# list type property. # list type property.
simulation_movement = movement.getDeliveryRelatedValue() simulation_movement = movement.getDeliveryRelatedValue()
movement.setProperty(solved_property, movement.setProperty(solved_property,
simulation_movement.getProperty(solved_property)) simulation_movement.getProperty(solved_property))
for simulation_movement in movement.getDeliveryRelatedValueList():
self._clearRecordedPropertyRecursively(simulation_movement,
solved_property)
# Finish solving # Finish solving
self.succeed() self.succeed()
def _clearRecordedPropertyRecursively(self, simulation_movement, property_id):
for applied_rule in simulation_movement.objectValues():
for child_simulation_movement in applied_rule.objectValues():
child_simulation_movement.clearRecordedProperty(property_id)
self._clearRecordedPropertyRecursively(child_simulation_movement,
property_id)
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