Commit 6684eff4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

'delivery' category is also used to record the relation between a solver...

'delivery' category is also used to record the relation between a solver decision and a delivery movement, so we need to specify portal_type in order to get related simulation movements only.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31281 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bcd8fccd
...@@ -60,9 +60,10 @@ class AcceptSolver(XMLObject): ...@@ -60,9 +60,10 @@ class AcceptSolver(XMLObject):
solved_property = self.getPortalTypeValue().getTestedProperty() solved_property = self.getPortalTypeValue().getTestedProperty()
for movement in self.getDeliveryValueList(): for movement in self.getDeliveryValueList():
new_value = movement.getProperty(solved_property) new_value = movement.getProperty(solved_property)
for simulation_movement in movement.getDeliveryRelatedValueList(): for simulation_movement in movement.getDeliveryRelatedValueList(
portal_type='Simulation Movement'):
if not simulation_movement.isPropertyRecorded(solved_property): if not simulation_movement.isPropertyRecorded(solved_property):
simulation_movement.recordProperty(solved_property) simulation_movement.recordProperty(solved_property)
solved_property.setProperty(solved_property, new_value) solved_property.setProperty(solved_property, new_value)
# Finish solving # Finish solving
self.succeed() self.succeed()
\ No newline at end of file
...@@ -64,7 +64,8 @@ class QuantitySplitSolver(XMLObject): ...@@ -64,7 +64,8 @@ class QuantitySplitSolver(XMLObject):
""" """
for delivery_line in self.getDeliveryValueList(): for delivery_line in self.getDeliveryValueList():
decision_quantity = delivery_line.getQuantity() decision_quantity = delivery_line.getQuantity()
simulation_movement_list = self.getDeliveryRelatedValueList() simulation_movement_list = self.getDeliveryRelatedValueList(
portal_type='Simulation Movement')
delivery_solver = self.portal_solvers.newDeliverySolver(self.getDeliverySolver(), simulation_movement_list) delivery_solver = self.portal_solvers.newDeliverySolver(self.getDeliverySolver(), simulation_movement_list)
# Update the quantity using delivery solver algorithm # Update the quantity using delivery solver algorithm
split_list = delivery_solver.setTotalQuantity(decision_quantity) split_list = delivery_solver.setTotalQuantity(decision_quantity)
...@@ -73,4 +74,4 @@ class QuantitySplitSolver(XMLObject): ...@@ -73,4 +74,4 @@ class QuantitySplitSolver(XMLObject):
new_movement = simulation_movement.copy() # Copy at same level new_movement = simulation_movement.copy() # Copy at same level
new_movement._setQuantity(split_quantity) new_movement._setQuantity(split_quantity)
new_movement._setStartDate(self.getStartDate()) new_movement._setStartDate(self.getStartDate())
new_movement._setStopDate(self.getStopDate()) new_movement._setStopDate(self.getStopDate())
\ No newline at end of file
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