Commit 3a737e33 authored by Vincent Pelletier's avatar Vincent Pelletier

Preferably call BankAccount_checkBalance on document causing the debit.

parent 609e55ad
......@@ -84,7 +84,7 @@ else:\n
else:\n
check_price = check_operation_line.getPrice()\n
bank_account_dict[account_path] = check_price\n
error = context.BankAccount_checkBalance(account_path, check_operation_line.getPrice())\n
error = obj.BankAccount_checkBalance(account_path, check_operation_line.getPrice())\n
\n
if error[\'error_code\'] == 1:\n
msg = Message(domain=\'ui\', message="Bank account $account is not sufficient on line $line.",\n
......
......@@ -64,7 +64,7 @@ for check_operation_line in transaction.objectValues(portal_type=\'Check Operati
bank_account_dict[account_path] = account_value\n
amount_dict[account_path] = amount_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
error = transaction.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
......
......@@ -123,7 +123,7 @@ if total_debit>0:\n
context.BankingOperationLine_index(line)\n
\n
# Test if the account balance is sufficient.\n
error = context.BankAccount_checkBalance(bank_account.getRelativeUrl(), price)\n
error = transaction.BankAccount_checkBalance(bank_account.getRelativeUrl(), price)\n
if error[\'error_code\'] == 1:\n
msg = Message(domain=\'ui\', message="Bank account is not sufficient.")\n
raise ValidationFailed, (msg,)\n
......
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