Commit 90a9a09d authored by Julien Muchembled's avatar Julien Muchembled

amount_generator: a line can be both final and intermediate

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33969 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 049dd675
...@@ -226,8 +226,13 @@ class AmountGeneratorMixin: ...@@ -226,8 +226,13 @@ class AmountGeneratorMixin:
property_dict['base_application'] = getBaseApplication() # Required property_dict['base_application'] = getBaseApplication() # Required
#property_dict['trade_phase_list'] = amount_generator_cell.getTradePhaseList() # Required moved to MappedValue #property_dict['trade_phase_list'] = amount_generator_cell.getTradePhaseList() # Required moved to MappedValue
property_dict['id'] = amount_generator_cell.getRelativeUrl().replace('/', '_') property_dict['id'] = amount_generator_cell.getRelativeUrl().replace('/', '_')
try:
base_contribution_list = \
amount_generator_cell.getBaseContributionList()
except AttributeError:
continue
# Case 2: the cell defines a temporary calculation line # Case 2: the cell defines a temporary calculation line
elif getattr(amount_generator_cell, 'getBaseContributionList', None) is not None: if base_contribution_list:
# Define a key in order to aggregate amounts in cells # Define a key in order to aggregate amounts in cells
# base_application MUST be defined # base_application MUST be defined
# #
...@@ -249,13 +254,9 @@ class AmountGeneratorMixin: ...@@ -249,13 +254,9 @@ class AmountGeneratorMixin:
# Then collect the mapped properties # Then collect the mapped properties
for key in amount_generator_cell.getMappedValuePropertyList(): for key in amount_generator_cell.getMappedValuePropertyList():
property_dict[key] = amount_generator_cell.getProperty(key) property_dict[key] = amount_generator_cell.getProperty(key)
property_dict['category_list'] = \
amount_generator_cell.getCategoryMembershipList(
amount_generator_cell.getMappedValueBaseCategoryList(), base=1)
# For intermediate calculations, # For intermediate calculations,
# base_contribution_list MUST be defined # base_contribution_list MUST be defined
property_dict['base_contribution_list'] = \ property_dict['base_contribution_list'] = base_contribution_list
amount_generator_cell.getBaseContributionList() # Required
for property_dict in resource_amount_aggregate.itervalues(): for property_dict in resource_amount_aggregate.itervalues():
base_application = property_dict.pop('base_application') base_application = property_dict.pop('base_application')
# property_dict should include # property_dict should include
......
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