Commit 6ffb763a authored by Łukasz Nowak's avatar Łukasz Nowak

Support rules without trade phase.

For example Trade Model Rules do not define trade phase on them, so let other
checks to apply it or not.
parent c088b14c
...@@ -50,19 +50,26 @@ ...@@ -50,19 +50,26 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>movement = context\n <value> <string encoding="cdata"><![CDATA[
movement = context\n
\n \n
business_link = movement.getCausalityValue(portal_type=\'Business Link\')\n business_link = movement.getCausalityValue(portal_type=\'Business Link\')\n
\n \n
if len(business_link.getParentValue().getBusinessLinkValueList(trade_phase=rule.getTradePhaseList())) == 0:\n rule_trade_phase_list = rule.getTradePhaseList()\n
# If Business Process does not define invoicing do not apply\n if len(rule_trade_phase_list) > 0:\n
return False\n # if rule defines trade phase check if there is sense to apply it\n
if len(business_link.getParentValue().getBusinessLinkValueList(trade_phase=rule_trade_phase_list)) == 0:\n
# If Business Process does not define trade phase do not apply\n
return False\n
\n \n
if movement.getSimulationState() in business_link.getCompletedStateList():\n if movement.getSimulationState() in business_link.getCompletedStateList():\n
return True\n return True\n
\n \n
return False\n return False\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
398 399
\ No newline at end of file \ No newline at end of file
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