Commit 0a1bf640 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

record only solved property.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32399 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f5cb884b
......@@ -84,17 +84,18 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject):
value_dict.update({'quantity':new_quantity})
else:
value_dict.update({solved_property:new_value})
self._solveRecursively(simulation_movement, value_dict)
self._solveRecursively(simulation_movement, value_dict,
solved_property)
simulation_movement.expand()
# Finish solving
self.succeed()
def _solveRecursively(self, simulation_movement, value_dict=None):
def _solveRecursively(self, simulation_movement, value_dict=None,
property_id=None):
"""
Update value of the current simulation movement, and update
his parent movement.
"""
for property_id in value_dict.iterkeys():
if not simulation_movement.isPropertyRecorded(property_id):
simulation_movement.recordProperty(property_id)
simulation_movement.edit(**value_dict)
......@@ -104,4 +105,5 @@ class AcceptSolver(SolverMixin, ConfigurableMixin, XMLObject):
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)
self._solveRecursively(parent_movement, value_dict=value_dict,
property_id=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