Commit bd8f6198 authored by Alexandre Boeglin's avatar Alexandre Boeglin

should not try to divide by none or 0

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19815 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent be4ad74c
......@@ -721,8 +721,9 @@ class Resource(XMLMatrix, Variated):
for surcharge_ratio in price_parameter_dict['surcharge_ratio']:
sum_surcharge_ratio += surcharge_ratio
unit_base_price = unit_base_price * sum_surcharge_ratio
# Divide by the priced quantity
if unit_base_price is not None:
# Divide by the priced quantity if not (None, 0)
if unit_base_price is not None\
and price_parameter_dict['priced_quantity']:
priced_quantity = price_parameter_dict['priced_quantity']
unit_base_price = unit_base_price / priced_quantity
# Return result
......
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