Commit 338059f5 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix listbox selection name.

Baobab_checkCounterDateOpen must raise in case of an error instead of returning a boolean value.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14948 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89fc7436
...@@ -65,7 +65,10 @@ ...@@ -65,7 +65,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># return 1 if the counter date is open/closing for the given date and the given site\n <value> <string># Raise ValidationFailed if the counter date not opened for the given date and the given site\n
\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n \n
if date is None:\n if date is None:\n
# get current date\n # get current date\n
...@@ -89,9 +92,8 @@ if site is None:\n ...@@ -89,9 +92,8 @@ if site is None:\n
site = context.Baobab_getVaultSite(site)\n site = context.Baobab_getVaultSite(site)\n
\n \n
if context.portal_catalog.countResults(portal_type=\'Counter Date\', start_date=str(date), site_id=site.getId(), simulation_state="open")[0][0] == 0:\n if context.portal_catalog.countResults(portal_type=\'Counter Date\', start_date=str(date), site_id=site.getId(), simulation_state="open")[0][0] == 0:\n
return 0\n msg = Message(domain = "ui", message="Transaction not in the good counter date")\n
else:\n raise ValidationFailed, (msg,)\n
return 1\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -150,6 +152,10 @@ else:\n ...@@ -150,6 +152,10 @@ else:\n
<tuple> <tuple>
<string>site</string> <string>site</string>
<string>date</string> <string>date</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>None</string> <string>None</string>
<string>DateTime</string> <string>DateTime</string>
<string>_getattr_</string> <string>_getattr_</string>
...@@ -158,6 +164,7 @@ else:\n ...@@ -158,6 +164,7 @@ else:\n
<string>len</string> <string>len</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>str</string> <string>str</string>
<string>msg</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -481,7 +481,7 @@ ...@@ -481,7 +481,7 @@
</item> </item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string>accounting_date_list_selection</string> </value> <value> <string>counter_date_list_selection</string> </value>
</item> </item>
<item> <item>
<key> <string>sort</string> </key> <key> <string>sort</string> </key>
......
285 286
\ 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