Commit 8f6763b4 authored by Aurel's avatar Aurel

check that counter date and couter are open to do a usual cahs transfer

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8562 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3eec30c6
...@@ -74,8 +74,21 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n ...@@ -74,8 +74,21 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
\n \n
transaction = state_change.object\n transaction = state_change.object\n
\n
vault = transaction.getSource()\n vault = transaction.getSource()\n
date = transaction.getStartDate()\n
\n
# check we are in an opened accounting day\n
if not transaction.Baobab_checkCounterDateOpen(site=vault, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n
raise ValidationFailed, (msg,)\n
\n
# check counter is opened\n
site = transaction.getDestinationValue()\n
if not context.Baobab_checkCounterOpened(site):\n
msg = Message(domain = "ui", message="Counter is not opened")\n
raise ValidationFailed, (msg,)\n
\n
\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Cash Delivery Line\')\n resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Cash Delivery Line\')\n
\n \n
# Get price and total_price.\n # Get price and total_price.\n
...@@ -147,10 +160,13 @@ elif resource <> 0 :\n ...@@ -147,10 +160,13 @@ elif resource <> 0 :\n
<string>_getattr_</string> <string>_getattr_</string>
<string>transaction</string> <string>transaction</string>
<string>vault</string> <string>vault</string>
<string>date</string>
<string>msg</string>
<string>site</string>
<string>context</string>
<string>resource</string> <string>resource</string>
<string>amount</string> <string>amount</string>
<string>total_price</string> <string>total_price</string>
<string>msg</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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