Commit 53c7dcf5 authored by Aurel's avatar Aurel

way to check account position was wrong

when delivering, do all check in deliver_action

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14949 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 338059f5
......@@ -72,6 +72,11 @@ from Products.ERP5Type.Message import Message\n
\n
transaction = state_change[\'object\']\n
\n
site = transaction.getSite()\n
date = transaction.getStartDate()\n
transaction.Baobab_checkCounterDateOpen(site=site, date=date)\n
transaction.Baobab_checkAccountingDateOpen(site=site, date=date)\n
\n
# Check the amount.\n
price = transaction.getSourceTotalAssetPrice()\n
if price is None or price <= 0:\n
......@@ -111,7 +116,7 @@ for check_operation_line in transaction.contentValues(filter = {\'portal_type\'
raise ValidationFailed, (msg,)\n
\n
# Test if the account balance is sufficient.\n
error = context.BankAccount_checkBalance(source_bank_account.getRelativeUrl(), check_operation_line.getTotalQuantity())\n
error = context.BankAccount_checkBalance(source_bank_account.getRelativeUrl(), check_operation_line.getPrice())\n
if error[\'error_code\'] == 1:\n
msg = Message(domain=\'ui\', message="Source bank account is not sufficient.")\n
raise ValidationFailed, (msg,)\n
......@@ -195,6 +200,8 @@ if transaction.getSimulationState() == "draft":\n
<string>_getitem_</string>
<string>transaction</string>
<string>_getattr_</string>
<string>site</string>
<string>date</string>
<string>price</string>
<string>None</string>
<string>msg</string>
......
......@@ -69,6 +69,8 @@
\n
# Check getBaobabSource and getBaobabDestination\n
transaction.Base_checkBaobabSourceAndDestination()\n
\n
context.validateConsistency(state_change)\n
</string> </value>
</item>
<item>
......@@ -122,6 +124,7 @@ transaction.Base_checkBaobabSourceAndDestination()\n
<string>_getitem_</string>
<string>transaction</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
......
......@@ -57,7 +57,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string>validateSourceAndDestination</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -57,7 +57,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string>validateConsistency</string> </value>
<value> <string>validateSourceAndDestination</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
280
\ No newline at end of file
282
\ 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