Commit 92010ba4 authored by Aurel's avatar Aurel

do not allow to opened multiple accouting date

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19267 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2a3fa7cc
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># Check that it is possible to open the accounting date.\n <value> <string encoding="cdata"><![CDATA[
# Check that it is possible to open the accounting date.\n
\n \n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
...@@ -79,7 +81,14 @@ site_uid = accounting_date.getSiteUid()\n ...@@ -79,7 +81,14 @@ site_uid = accounting_date.getSiteUid()\n
if site_uid is None:\n if site_uid is None:\n
msg = Message(domain=\'ui\',message="Sorry, the site is not defined")\n msg = Message(domain=\'ui\',message="Sorry, the site is not defined")\n
raise ValidationFailed (msg,)\n raise ValidationFailed (msg,)\n
</string> </value> \n
opened_date_list = accounting_date.portal_catalog(portal_type="Accounting Date", simulation_state="opened", default_site_uid=accounting_date.getSiteUid())\n
if len(opened_date_list) > 0:\n
msg = Message(domain=\'ui\',message="Sorry, another accounting date is already opened")\n
raise ValidationFailed (msg,)\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -134,6 +143,8 @@ if site_uid is None:\n ...@@ -134,6 +143,8 @@ if site_uid is None:\n
<string>site_uid</string> <string>site_uid</string>
<string>None</string> <string>None</string>
<string>msg</string> <string>msg</string>
<string>opened_date_list</string>
<string>len</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
417 418
\ 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