Commit 0f9fe266 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix undefined source_bank_account variable.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39334 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ddde94a7
......@@ -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() == "draft":\n
<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>
......
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