Commit bc62ea97 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

In adopting 'quantity', we need to recalculate delivery_ratio for all related simulation movements.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44621 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 31adaed9
...@@ -79,8 +79,11 @@ class AdoptSolver(SolverMixin, ConfigurableMixin, XMLObject): ...@@ -79,8 +79,11 @@ class AdoptSolver(SolverMixin, ConfigurableMixin, XMLObject):
for solved_property in solved_property_list: for solved_property in solved_property_list:
# XXX hardcoded # XXX hardcoded
if solved_property == 'quantity': if solved_property == 'quantity':
# For 'quantity' case, we need to recalculate delivery_ratio
# for all related simulation movements.
simulation_movement_list = movement.getDeliveryRelatedValueList()
total_quantity = sum( total_quantity = sum(
[x.getQuantity() for x in movement.getDeliveryRelatedValueList()]) [x.getQuantity() for x in simulation_movement_list])
movement.setQuantity(total_quantity) movement.setQuantity(total_quantity)
for simulation_movement in simulation_movement_list: for simulation_movement in simulation_movement_list:
quantity = simulation_movement.getQuantity() quantity = simulation_movement.getQuantity()
......
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