Commit 6c128616 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

no need to pass solved_property_list, because it is apparent from value_dict.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33504 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5c1dcb0a
...@@ -84,14 +84,12 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject): ...@@ -84,14 +84,12 @@ 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, self._solveRecursively(simulation_movement, value_dict)
solved_property_list)
simulation_movement.expand() simulation_movement.expand()
# Finish solving # Finish solving
self.succeed() self.succeed()
def _solveRecursively(self, simulation_movement, value_dict=None, def _solveRecursively(self, simulation_movement, value_dict=None):
property_id_list=None):
""" """
Update value of the current simulation movement, and update Update value of the current simulation movement, and update
his parent movement. his parent movement.
...@@ -101,10 +99,9 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject): ...@@ -101,10 +99,9 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject):
if parent_movement.getPortalType() == 'Simulation Movement' and \ if parent_movement.getPortalType() == 'Simulation Movement' and \
not parent_movement.isFrozen(): not parent_movement.isFrozen():
# backtrack to the parent movement while it is not frozen # backtrack to the parent movement while it is not frozen
self._solveRecursively(parent_movement, value_dict=value_dict, self._solveRecursively(parent_movement, value_dict=value_dict)
property_id_list=property_id_list)
else: else:
for property_id in property_id_list: 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(): for property_id, value in value_dict.iteritems():
......
...@@ -77,8 +77,7 @@ class UnifySolver(AcceptSolver): ...@@ -77,8 +77,7 @@ 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, self._solveRecursively(simulation_movement, value_dict)
[solved_property])
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