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 355
\ No newline at end of file \ No newline at end of file
...@@ -171,10 +171,20 @@ ...@@ -171,10 +171,20 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>membership_criterion_category</string> </key> <key> <string>membership_criterion_category</string> </key>
<value> <value>
<tuple/> <tuple>
<string>trade_phase/vifib/accounting</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -212,7 +222,7 @@ ...@@ -212,7 +222,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <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>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -175,10 +175,20 @@ ...@@ -175,10 +175,20 @@
<key> <string>lead_time</string> </key> <key> <string>lead_time</string> </key>
<value> <float>10.0</float> </value> <value> <float>10.0</float> </value>
</item> </item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>membership_criterion_category</string> </key> <key> <string>membership_criterion_category</string> </key>
<value> <value>
<tuple/> <tuple>
<string>trade_phase/vifib/delivery</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -216,7 +226,7 @@ ...@@ -216,7 +226,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <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>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -173,10 +173,20 @@ ...@@ -173,10 +173,20 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>membership_criterion_category</string> </key> <key> <string>membership_criterion_category</string> </key>
<value> <value>
<tuple/> <tuple>
<string>trade_phase/vifib/invoicing</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -214,7 +224,7 @@ ...@@ -214,7 +224,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <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>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -113,10 +113,20 @@ ...@@ -113,10 +113,20 @@
<key> <string>int_index</string> </key> <key> <string>int_index</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>membership_criterion_category</string> </key> <key> <string>membership_criterion_category</string> </key>
<value> <value>
<tuple/> <tuple>
<string>trade_phase/vifib/order</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -137,7 +147,7 @@ ...@@ -137,7 +147,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <key> <string>test_tales_expression</string> </key>
<value> <string>python: context.BusinessLink_testOrderLink()</string> </value> <value> <string>python: True</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -169,10 +169,20 @@ ...@@ -169,10 +169,20 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>trade_phase</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>membership_criterion_category</string> </key> <key> <string>membership_criterion_category</string> </key>
<value> <value>
<tuple/> <tuple>
<string>trade_phase/vifib/payment</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -210,7 +220,7 @@ ...@@ -210,7 +220,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <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>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
85 86
\ 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