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 ...@@ -72,6 +72,11 @@ from Products.ERP5Type.Message import Message\n
\n \n
transaction = state_change[\'object\']\n transaction = state_change[\'object\']\n
\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 # Check the amount.\n
price = transaction.getSourceTotalAssetPrice()\n price = transaction.getSourceTotalAssetPrice()\n
if price is None or price <= 0:\n if price is None or price <= 0:\n
...@@ -111,7 +116,7 @@ for check_operation_line in transaction.contentValues(filter = {\'portal_type\' ...@@ -111,7 +116,7 @@ for check_operation_line in transaction.contentValues(filter = {\'portal_type\'
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
# Test if the account balance is sufficient.\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 if error[\'error_code\'] == 1:\n
msg = Message(domain=\'ui\', message="Source bank account is not sufficient.")\n msg = Message(domain=\'ui\', message="Source bank account is not sufficient.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
...@@ -195,6 +200,8 @@ if transaction.getSimulationState() == "draft":\n ...@@ -195,6 +200,8 @@ if transaction.getSimulationState() == "draft":\n
<string>_getitem_</string> <string>_getitem_</string>
<string>transaction</string> <string>transaction</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>site</string>
<string>date</string>
<string>price</string> <string>price</string>
<string>None</string> <string>None</string>
<string>msg</string> <string>msg</string>
......
...@@ -69,6 +69,8 @@ ...@@ -69,6 +69,8 @@
\n \n
# Check getBaobabSource and getBaobabDestination\n # Check getBaobabSource and getBaobabDestination\n
transaction.Base_checkBaobabSourceAndDestination()\n transaction.Base_checkBaobabSourceAndDestination()\n
\n
context.validateConsistency(state_change)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -122,6 +124,7 @@ transaction.Base_checkBaobabSourceAndDestination()\n ...@@ -122,6 +124,7 @@ transaction.Base_checkBaobabSourceAndDestination()\n
<string>_getitem_</string> <string>_getitem_</string>
<string>transaction</string> <string>transaction</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string>validateSourceAndDestination</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string>validateConsistency</string> </value> <value> <string>validateSourceAndDestination</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
280 282
\ No newline at end of file \ 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