Commit 1e9a027d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

no need to propagate changes to upper level.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34003 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 06bacd20
...@@ -85,25 +85,10 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject): ...@@ -85,25 +85,10 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject):
value_dict.update({'quantity':new_quantity}) value_dict.update({'quantity':new_quantity})
else: else:
value_dict.update({solved_property:new_value}) value_dict.update({solved_property:new_value})
self._solveRecursively(simulation_movement, value_dict) for property_id, value in value_dict.iteritems():
simulation_movement.expand()
# Finish solving
self.succeed()
def _solveRecursively(self, simulation_movement, value_dict=None):
"""
Update value of the current simulation movement, and update
his parent movement.
"""
applied_rule = simulation_movement.getParentValue()
parent_movement = applied_rule.getParentValue()
if parent_movement.getPortalType() == 'Simulation Movement' and \
not parent_movement.isFrozen():
# backtrack to the parent movement while it is not frozen
self._solveRecursively(parent_movement, value_dict=value_dict)
else:
for property_id in value_dict.iterkeys():
if not simulation_movement.isPropertyRecorded(property_id): if not simulation_movement.isPropertyRecorded(property_id):
simulation_movement.recordProperty(property_id) simulation_movement.recordProperty(property_id)
for property_id, value in value_dict.iteritems():
simulation_movement.setMappedProperty(property_id, value) simulation_movement.setMappedProperty(property_id, value)
simulation_movement.expand()
# Finish solving
self.succeed()
...@@ -80,7 +80,10 @@ class UnifySolver(AcceptSolver): ...@@ -80,7 +80,10 @@ class UnifySolver(AcceptSolver):
for x in self.getDeliveryValue().getMovementList()], []) for x in self.getDeliveryValue().getMovementList()], [])
for simulation_movement in simulation_movement_list: for simulation_movement in simulation_movement_list:
value_dict = {solved_property:new_value} value_dict = {solved_property:new_value}
self._solveRecursively(simulation_movement, value_dict) for property_id, value in value_dict.iteritems():
if not simulation_movement.isPropertyRecorded(property_id):
simulation_movement.recordProperty(property_id)
simulation_movement.setMappedProperty(property_id, value)
simulation_movement.expand() simulation_movement.expand()
# Finish solving # Finish solving
self.succeed() 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