Commit 78bda3b2 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 ee0e915c
......@@ -121,10 +121,20 @@
<key> <string>int_index</string> </key>
<value> <int>3</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/default/accounting</string>
</tuple>
</value>
</item>
<item>
......@@ -145,7 +155,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>
......
......@@ -126,10 +126,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/default/delivery</string>
</tuple>
</value>
</item>
<item>
......@@ -150,7 +160,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.BusinessLink_testDeliveryLink(\'Delivery Root Simulation Rule\', \'Delivery Simulation Rule\')</string> </value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -124,10 +124,20 @@
<key> <string>int_index</string> </key>
<value> <int>2</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/default/invoicing</string>
</tuple>
</value>
</item>
<item>
......@@ -148,7 +158,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/default/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>
......
......@@ -103,10 +103,20 @@
<key> <string>int_index</string> </key>
<value> <int>4</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/default/payment</string>
</tuple>
</value>
</item>
<item>
......@@ -127,7 +137,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>
......
<?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>
32
\ No newline at end of file
33
\ 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