Commit 7f0c1ec4 authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: correct a division by zero.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3225 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1801a8ae
...@@ -515,6 +515,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -515,6 +515,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
quantity = simulation_movement.getQuantity() quantity = simulation_movement.getQuantity()
simulation_movement.setDeliveryRatio(quantity/total_quantity) simulation_movement.setDeliveryRatio(quantity/total_quantity)
else: else:
if len(sim_mvt_list) != 0:
# Distribute equally ratio to all movement # Distribute equally ratio to all movement
mvt_ratio = 1 / len(sim_mvt_list) mvt_ratio = 1 / len(sim_mvt_list)
for simulation_movement in sim_mvt_list: for simulation_movement in sim_mvt_list:
......
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