Commit 7a68e825 authored by Łukasz Nowak's avatar Łukasz Nowak

- it is needed to apply models only two times - once for real input...

 - it is needed to apply models only two times - once for real input movements, second one for generated values globally


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27774 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent adb0ef03
...@@ -224,19 +224,15 @@ class TradeCondition(Path, Transformation, XMLMatrix): ...@@ -224,19 +224,15 @@ class TradeCondition(Path, Transformation, XMLMatrix):
trade_model_line_composed_list = \ trade_model_line_composed_list = \
self.getTradeModelLineComposedList(context) self.getTradeModelLineComposedList(context)
need_to_run = 1 # initialise run then rerun only once, as trade_model_line_composed_list
while need_to_run: # XXX Dangerous code. This can leed to infinite loop # is sorted in good way to have simple algorithm
need_to_run = 0 for pass_type in ['initialise', 'rerun']:
for model_line in trade_model_line_composed_list: for model_line in trade_model_line_composed_list:
model_line_result = model_line.getAggregatedAmountList(context, result.extend(model_line.getAggregatedAmountList(context,
movement_list=movement_list, movement_list=movement_list,
current_aggregated_amount_list=result, current_aggregated_amount_list=result,
**kw) **kw))
result.extend(model_line_result) movement_list = result # apply model again on generated movements
if len(result) != len(movement_list):
# something was added
need_to_run = 1
movement_list = result
# remove movement that should not be created # remove movement that should not be created
movement_list = [] movement_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