Commit ae8d338b authored by Julien Muchembled's avatar Julien Muchembled

amount_generator: backward compatibility for TTR with efficiency=0

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42692 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c730e61e
...@@ -319,8 +319,11 @@ class AmountGeneratorMixin: ...@@ -319,8 +319,11 @@ class AmountGeneratorMixin:
amount = getRoundingProxy(amount, context=self) amount = getRoundingProxy(amount, context=self)
result.append(amount) result.append(amount)
# Contribute # Contribute
quantity *= property_dict.get('price', 1) / \ quantity *= property_dict.get('price', 1)
property_dict.get('efficiency', 1) try:
quantity /= property_dict.get('efficiency', 1)
except ZeroDivisionError:
quantity *= float('inf')
for base_contribution in property_dict['base_contribution_set']: for base_contribution in property_dict['base_contribution_set']:
base_amount.contribute(base_contribution, quantity) base_amount.contribute(base_contribution, quantity)
......
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