Commit cf2de692 authored by Jérome Perrin's avatar Jérome Perrin

distribute properly quantity ratio in case of 0 quantity (was using integer

division and setting a quantity ratio of 0)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30377 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bf9d2ceb
...@@ -362,7 +362,7 @@ class FakeMovement: ...@@ -362,7 +362,7 @@ class FakeMovement:
movement.edit(delivery_ratio=quantity*delivery_ratio/total_quantity) movement.edit(delivery_ratio=quantity*delivery_ratio/total_quantity)
else: else:
# Distribute equally ratio to all movement # Distribute equally ratio to all movement
mvt_ratio = 1 / len(self.__movement_list) mvt_ratio = 1. / len(self.__movement_list)
for movement in self.__movement_list: for movement in self.__movement_list:
movement.edit(delivery_ratio=mvt_ratio) movement.edit(delivery_ratio=mvt_ratio)
......
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