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

no need to clear recorded property for adoption.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32401 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1943de2d
...@@ -80,23 +80,11 @@ class AdoptSolver(SolverMixin, ConfigurableMixin, XMLObject): ...@@ -80,23 +80,11 @@ 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)
...@@ -31,9 +31,8 @@ import zope.interface ...@@ -31,9 +31,8 @@ import zope.interface
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5.Document.AcceptSolver import AcceptSolver from Products.ERP5.Document.AcceptSolver import AcceptSolver
from Products.ERP5.Document.AdoptSolver import AdoptSolver
class UnifySolver(AcceptSolver, AdoptSolver): class UnifySolver(AcceptSolver):
""" """
""" """
meta_type = 'ERP5 Unify Solver' meta_type = 'ERP5 Unify Solver'
...@@ -79,8 +78,6 @@ class UnifySolver(AcceptSolver, AdoptSolver): ...@@ -79,8 +78,6 @@ class UnifySolver(AcceptSolver, AdoptSolver):
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)
self._clearRecordedPropertyRecursively(simulation_movement,
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