Commit a9b14c3f authored by Grégory Wisniewski's avatar Grégory Wisniewski

Open accounting dates within the current month only

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35368 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 03d52550
......@@ -70,6 +70,11 @@ if site_uid is None:\n
msg = Message(domain=\'ui\',message="Sorry, the site is not defined")\n
raise ValidationFailed (msg,)\n
\n
# Check if the start_date is in the current month\n
if not accounting_date.getStartDate().isCurrentMonth():\n
msg = Message(domain=\'ui\', message=\'Date must be within the current month\')\n
raise ValidationFailed (msg,)\n
\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
......
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