Commit 4466af68 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use sum() instead of reduce().

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23674 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c47a9be
......@@ -301,9 +301,8 @@ class DeliveryBuilder(OrderBuilder):
[s_m]
for s_m_list_per_movement in delivery_dict.values():
total_quantity = reduce(lambda x, y: \
x + quantity_dict.get(y, y.getQuantity()),
s_m_list_per_movement, 0)
total_quantity = sum([quantity_dict.get(s_m, s_m.getQuantity()) \
for s_m in s_m_list_per_movement])
if total_quantity != 0.0:
for s_m in s_m_list_per_movement:
delivery_ratio = quantity_dict.get(s_m, s_m.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