[Erp5-report] r32574 kazuhiko - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 16 07:25:52 CET 2010
Author: kazuhiko
Date: Tue Feb 16 07:25:51 2010
New Revision: 32574
URL: http://svn.erp5.org?rev=32574&view=rev
Log:
improve test method for payment rule based on existing PaymentRule.py.
Modified:
erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/SimulationMovement_testPaymentRule.xml
erp5/trunk/bt5/erp5_accounting/bt/revision
Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/SimulationMovement_testPaymentRule.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/SimulationMovement_testPaymentRule.xml?rev=32574&r1=32573&r2=32574&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/SimulationMovement_testPaymentRule.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/SimulationMovement_testPaymentRule.xml [utf8] Tue Feb 16 07:25:51 2010
@@ -55,19 +55,26 @@
<key> <string>_body</string> </key>
<value> <string>movement = context\n
\n
-if movement.getId() not in (\'receivable\',):\n
- return False\n
-\n
parent = movement.getParentValue()\n
if parent.getPortalType() != \'Applied Rule\':\n
return False\n
\n
parent_rule = parent.getSpecialiseValue()\n
-if parent_rule.getPortalType() not in [\'Invoice Transaction Rule\']:\n
+if parent_rule.getPortalType() not in (\'Invoice Transaction Rule\',):\n
return False\n
\n
-delivery_movement = movement.getDeliveryValue()\n
-return delivery_movement is None or delivery_movement.getPortalType() in movement.getPortalAccountingMovementTypeList()\n
+receivable_account_type_list = (\'asset/receivable\',)\n
+payable_account_type_list = (\'liability/payable\',)\n
+\n
+for account in (movement.getSourceValue(portal_type=\'Account\'),\n
+ movement.getDestinationValue(portal_type=\'Account\')):\n
+ if account is not None:\n
+ account_type = account.getAccountType()\n
+ if account_type in receivable_account_type_list or \\\n
+ account_type in payable_account_type_list:\n
+ return True\n
+\n
+return False\n
</string> </value>
</item>
<item>
@@ -108,11 +115,16 @@
<string>context</string>
<string>movement</string>
<string>_getattr_</string>
+ <string>parent</string>
<string>False</string>
- <string>parent</string>
<string>parent_rule</string>
- <string>delivery_movement</string>
+ <string>receivable_account_type_list</string>
+ <string>payable_account_type_list</string>
+ <string>_getiter_</string>
+ <string>account</string>
<string>None</string>
+ <string>account_type</string>
+ <string>True</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=32574&r1=32573&r2=32574&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Tue Feb 16 07:25:51 2010
@@ -1,1 +1,1 @@
-1103
+1104
More information about the Erp5-report
mailing list