Commit 6430ccc3 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

amount_generator: getBaseAmountQuantity method can differ per amount generator line.

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