[Erp5-report] r39334 vincent - in /erp5/trunk/bt5/erp5_banking_check: WorkflowTemplateItem/...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 19 11:41:27 CEST 2010


Author: vincent
Date: Tue Oct 19 11:41:25 2010
New Revision: 39334

URL: http://svn.erp5.org?rev=39334&view=rev
Log:
Fix undefined source_bank_account variable.

Modified:
    erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml
    erp5/trunk/bt5/erp5_banking_check/bt/revision

Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml?rev=39334&r1=39333&r2=39334&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml [utf8] Tue Oct 19 11:41:25 2010
@@ -60,11 +60,15 @@ transaction = state_change[\'object\']\n
 \n
 # Test if the account balance is sufficient.\n
 bank_account_dict = {}\n
+amount_dict = {}\n
 for check_operation_line in transaction.objectValues(portal_type=\'Check Operation Line\'):\n
-  account_path = check_operation_line.getSourcePaymentValue().getRelativeUrl()\n
-  bank_account_dict[account_path] = bank_account_dict.get(account_path, 0) + check_operation_line.getPrice()\n
-for account_path, amount in bank_account_dict.items():\n
+  account_value = check_operation_line.getSourcePaymentValue()\n
+  account_path = account_value.getRelativeUrl()\n
+  bank_account_dict[account_path] = account_value\n
+  amount_dict[account_path] = bank_account_dict.get(account_path, 0) + check_operation_line.getPrice()\n
+for account_path, amount in amount_dict.items():\n
   error = context.BankAccount_checkBalance(account_path, amount)[\'error_code\']\n
+  source_bank_account = bank_account_dict[account_path]\n
   if error == 1:\n
     raise ValidationFailed, (Message(domain=\'ui\', message="Bank account $account is not sufficient.",\n
       mapping={"account": source_bank_account.getInternalBankAccountNumber()}), )\n
@@ -130,9 +134,11 @@ if transaction.getSimulationState() == "
                             <string>_getitem_</string>
                             <string>transaction</string>
                             <string>bank_account_dict</string>
+                            <string>amount_dict</string>
                             <string>_getiter_</string>
                             <string>_getattr_</string>
                             <string>check_operation_line</string>
+                            <string>account_value</string>
                             <string>account_path</string>
                             <string>_write_</string>
                             <string>amount</string>

Modified: erp5/trunk/bt5/erp5_banking_check/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/bt/revision?rev=39334&r1=39333&r2=39334&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/bt/revision [utf8] Tue Oct 19 11:41:25 2010
@@ -1 +1 @@
-465
+467
\ No newline at end of file




More information about the Erp5-report mailing list