Commit 04f44e5e authored by Tatuya Kamada's avatar Tatuya Kamada

Now Rule enable to expand no Business Path even if using BPM. Because Business...

Now Rule enable to expand no Business Path even if using BPM. Because Business Path is a predicate and no business path case exisits as the context.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34760 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b2d68d54
...@@ -62,14 +62,13 @@ class TradeModelRule(Rule): ...@@ -62,14 +62,13 @@ class TradeModelRule(Rule):
# business path specific # business path specific
business_path_list = business_process.getPathValueList( business_path_list = business_process.getPathValueList(
trade_phase=amount.getTradePhaseList(), context=context_movement) trade_phase=amount.getTradePhaseList(), context=context_movement)
if len(business_path_list) == 0: if len(business_path_list) > 1:
raise ValueError('Cannot find Business Path')
if len(business_path_list) != 1:
raise NotImplementedError('Only one Business Path is supported') raise NotImplementedError('Only one Business Path is supported')
business_path = business_path_list[0] if business_path_list:
business_path = business_path_list[0]
else:
business_path = None
movement_kw = self._getExpandablePropertyDict(applied_rule, movement_kw = self._getExpandablePropertyDict(applied_rule,
context_movement, business_path) context_movement, business_path)
......
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