Commit 5a56cd7c authored by Julien Muchembled's avatar Julien Muchembled

Find appropriate Business Link when a rule expands for several trade phases simultaneously

parent b7a04d55
...@@ -686,14 +686,15 @@ class BusinessProcess(Path, XMLObject): ...@@ -686,14 +686,15 @@ class BusinessProcess(Path, XMLObject):
id_index = 0 id_index = 0
base_id = amount.getId() base_id = amount.getId()
if update_property_dict is None: update_property_dict = {} if update_property_dict is None: update_property_dict = {}
filter_trade_phase = set(trade_phase).intersection
for trade_model_path in self.getTradeModelPathValueList(context=amount, trade_phase=trade_phase): for trade_model_path in self.getTradeModelPathValueList(context=amount, trade_phase=trade_phase):
id_index += 1 id_index += 1
movement = newTempSimulationMovement(trade_model_path, movement = newTempSimulationMovement(trade_model_path,
'%s_%s' % (base_id, id_index), notify_workflow=False) '%s_%s' % (base_id, id_index), notify_workflow=False)
kw = self._getPropertyAndCategoryDict(explanation, amount, trade_model_path, delay_mode=delay_mode) kw = self._getPropertyAndCategoryDict(explanation, amount, trade_model_path, delay_mode=delay_mode)
trade_phase = filter_trade_phase(trade_model_path.getTradePhaseList())
try: try:
kw['trade_phase'], = \ kw['trade_phase'], = trade_phase
set(trade_phase).intersection(trade_model_path.getTradePhaseList())
except ValueError: except ValueError:
pass pass
kw.update(update_property_dict) kw.update(update_property_dict)
......
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