Commit 9af919a4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Boxiang Sun

amount_generator: getBaseAmountQuantity method can differ per amount generator line.

parent b00724cd
......@@ -149,16 +149,17 @@ class BaseAmountDict(Implicit):
return value
def _getGeneratedAmountQuantity(self, base_amount, variation_category_list):
amount_generator_line = self.aq_base._amount_generator_line
try:
method = self._cache[base_amount]
method = self._cache[(amount_generator_line, base_amount)]
except KeyError:
method = self.aq_base._amount_generator_line._getTypeBasedMethod(
method = amount_generator_line._getTypeBasedMethod(
'getBaseAmountQuantityMethod')
if method is not None:
method = method(base_amount)
if method is None:
method = self.aq_base._amount_generator_line.getBaseAmountQuantity
self._cache[base_amount] = method
method = amount_generator_line.getBaseAmountQuantity
self._cache[(amount_generator_line, base_amount)] = method
if variation_category_list:
kw = dict(self._method_kw,
variation_category_list=variation_category_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