Commit 2ecc033c authored by Yusei Tahara's avatar Yusei Tahara

Add force_create_line parameter to TradeCondition.getAggregatedAmountList.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33632 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 70340ec3
......@@ -96,7 +96,7 @@ class Order(Delivery):
if not base_contribution_value_list:
# We cannot find any amount so that the result is 0.
return 0
current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding)
current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding, force_create_line=True)
trade_model_line = newTempTradeModelLine(
self,
'_temp_%s' % (self.getId()))
......
......@@ -260,7 +260,8 @@ class TradeCondition(Path, Transformation, XMLMatrix):
security.declareProtected(Permissions.AccessContentsInformation,
'getAggregatedAmountList')
def getAggregatedAmountList(self, context, movement_list=None, **kw):
def getAggregatedAmountList(self, context, movement_list=None,
force_create_line=False, **kw):
if movement_list is None:
movement_list = []
result = AggregatedAmountList()
......@@ -290,7 +291,7 @@ class TradeCondition(Path, Transformation, XMLMatrix):
'Reference must be set.')
for model_line in trade_model_line_composed_list:
if model_line.getReference() == movement_reference and\
model_line.isCreateLine():
(force_create_line or model_line.isCreateLine()):
aggregated_amount_list.append(movement)
return aggregated_amount_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