Commit f4fdfab7 authored by Alexandre Boeglin's avatar Alexandre Boeglin

* as the default behaviour when no script is defined is to return False,...

* as the default behaviour when no script is defined is to return False, InvoiceRule test script is no longer required
* other scripts were renamed to comply to naming conventions

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17661 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f5b130dc
......@@ -66,9 +66,7 @@
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple>
<string>InvoiceRule_testContextPortalType</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......
......@@ -77,7 +77,7 @@
<key> <string>test_method_id</string> </key>
<value>
<tuple>
<string>InvoiceTransactionRule_test</string>
<string>SimulationMovement_testInvoiceTransactionRule</string>
</tuple>
</value>
</item>
......
......@@ -21,6 +21,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
......@@ -33,6 +39,12 @@
<none/>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
......@@ -55,7 +67,7 @@
<key> <string>test_method_id</string> </key>
<value>
<tuple>
<string>InvoicingRule_testParentRulePortalType</string>
<string>SimulationMovement_testInvoicingRule</string>
</tuple>
</value>
</item>
......
......@@ -67,7 +67,7 @@
<key> <string>test_method_id</string> </key>
<value>
<tuple>
<string>PaymentRule_testMovementId</string>
<string>SimulationMovement_testPaymentRule</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>return context.getPortalType() in [\'Sale Invoice Transaction\']\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>rule</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>rule</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InvoiceRule_testContextPortalType</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -65,7 +65,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>parent = context.getParentValue()\n
<value> <string>movement = context\n
\n
parent = movement.getParentValue()\n
if parent.getPortalType() != \'Applied Rule\':\n
return False\n
\n
......@@ -73,11 +75,11 @@ parent_rule = parent.getSpecialiseValue()\n
if parent_rule.getPortalType() not in [\'Invoice Rule\', \'Invoicing Rule\']:\n
return False\n
\n
delivery_movement = context.getDeliveryValue()\n
if delivery_movement is not None and delivery_movement.getPortalType() not in context.getPortalInvoiceMovementTypeList():\n
delivery_movement = movement.getDeliveryValue()\n
if delivery_movement is not None and delivery_movement.getPortalType() not in movement.getPortalInvoiceMovementTypeList():\n
return False\n
\n
return rule.getMatchingCell(context) is not None\n
return rule.getMatchingCell(movement) is not None\n
</string> </value>
</item>
<item>
......@@ -127,8 +129,9 @@ return rule.getMatchingCell(context) is not None\n
<value>
<tuple>
<string>rule</string>
<string>_getattr_</string>
<string>context</string>
<string>movement</string>
<string>_getattr_</string>
<string>parent</string>
<string>False</string>
<string>parent_rule</string>
......@@ -150,7 +153,7 @@ return rule.getMatchingCell(context) is not None\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InvoiceTransactionRule_test</string> </value>
<value> <string>SimulationMovement_testInvoiceTransactionRule</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -65,7 +65,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>parent = context.getParentValue()\n
<value> <string>movement = context\n
\n
parent = movement.getParentValue()\n
if parent.getPortalType() == \'Applied Rule\':\n
parent_rule = parent.getSpecialiseValue()\n
if parent_rule.getPortalType() in [\'Order Rule\', \'Delivery Rule\']:\n
......@@ -120,8 +122,9 @@ return False\n
<value>
<tuple>
<string>rule</string>
<string>_getattr_</string>
<string>context</string>
<string>movement</string>
<string>_getattr_</string>
<string>parent</string>
<string>parent_rule</string>
<string>True</string>
......@@ -142,7 +145,7 @@ return False\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InvoicingRule_testParentRulePortalType</string> </value>
<value> <string>SimulationMovement_testInvoicingRule</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -65,10 +65,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if context.getId() not in (\'receivable\',):\n
<value> <string>movement = context\n
\n
if movement.getId() not in (\'receivable\',):\n
return False\n
\n
parent = context.getParentValue()\n
parent = movement.getParentValue()\n
if parent.getPortalType() != \'Applied Rule\':\n
return False\n
\n
......@@ -76,8 +78,8 @@ parent_rule = parent.getSpecialiseValue()\n
if parent_rule.getPortalType() not in [\'Invoice Transaction Rule\']:\n
return False\n
\n
delivery_movement = context.getDeliveryValue()\n
return delivery_movement is None or delivery_movement.getPortalType() in context.getPortalAccountingMovementTypeList()\n
delivery_movement = movement.getDeliveryValue()\n
return delivery_movement is None or delivery_movement.getPortalType() in movement.getPortalAccountingMovementTypeList()\n
</string> </value>
</item>
<item>
......@@ -127,8 +129,9 @@ return delivery_movement is None or delivery_movement.getPortalType() in context
<value>
<tuple>
<string>rule</string>
<string>_getattr_</string>
<string>context</string>
<string>movement</string>
<string>_getattr_</string>
<string>False</string>
<string>parent</string>
<string>parent_rule</string>
......@@ -150,7 +153,7 @@ return delivery_movement is None or delivery_movement.getPortalType() in context
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentRule_testMovementId</string> </value>
<value> <string>SimulationMovement_testPaymentRule</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
497
\ No newline at end of file
498
\ 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