Commit 3f9779b5 authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify predicate.

Use trade phase to match movements.

Note: Trade phase is setup twice: once on object and then as
membership_criterion_category.
parent b46e05e3
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if context.isTempDocument():\n
# no way to check deeper temporary movements\n
return True\n
\n
rule = context.getParentValue().getSpecialiseValue()\n
if rule is not None:\n
if rule.getPortalType() in expected_rule_portal_type_list:\n
# for sure does not apply\n
return True\n
\n
return False\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*expected_rule_portal_type_list</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessLink_testDeliveryLink</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>delivery = context.getDeliveryValue()\n
if delivery is not None:\n
if delivery.getParentValue().getPortalType() in context.getPortalOrderTypeList():\n
return True\n
return False\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessLink_testOrderLink</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
354
\ No newline at end of file
355
\ No newline at end of file
......@@ -171,10 +171,20 @@
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
<tuple>
<string>trade_phase/vifib/accounting</string>
</tuple>
</value>
</item>
<item>
......@@ -212,7 +222,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.BusinessLink_testDeliveryLink(\'Invoice Transaction Simulation Rule\')</string> </value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -175,10 +175,20 @@
<key> <string>lead_time</string> </key>
<value> <float>10.0</float> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
<tuple>
<string>trade_phase/vifib/delivery</string>
</tuple>
</value>
</item>
<item>
......@@ -216,7 +226,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.BusinessLink_testDeliveryLink(\'Delivery Root Simulation Rule\', \'Delivery Simulation Rule\', \'Subscription Item Root Simulation Rule\')</string> </value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -173,10 +173,20 @@
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
<tuple>
<string>trade_phase/vifib/invoicing</string>
</tuple>
</value>
</item>
<item>
......@@ -214,7 +224,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.BusinessLink_testDeliveryLink(\'Invoice Root Simulation Rule\', \'Invoice Simulation Rule\')</string> </value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -113,10 +113,20 @@
<key> <string>int_index</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
<tuple>
<string>trade_phase/vifib/order</string>
</tuple>
</value>
</item>
<item>
......@@ -137,7 +147,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.BusinessLink_testOrderLink()</string> </value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -169,10 +169,20 @@
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
<tuple>
<string>trade_phase/vifib/payment</string>
</tuple>
</value>
</item>
<item>
......@@ -210,7 +220,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.BusinessLink_testDeliveryLink(\'Payment Simulation Rule\')</string> </value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
85
\ No newline at end of file
86
\ 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