Commit 6ac1c8b0 authored by Vincent Pelletier's avatar Vincent Pelletier

Add check validity verification using Check_isValid.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13351 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44ad3708
...@@ -78,6 +78,8 @@ check_number = transaction.getAggregateFreeText()\n ...@@ -78,6 +78,8 @@ check_number = transaction.getAggregateFreeText()\n
\n \n
\n \n
check = transaction.Base_checkOrCreateCheck(reference=check_number)\n check = transaction.Base_checkOrCreateCheck(reference=check_number)\n
if not check.Check_isValid():\n
raise ValidationError, Message(domain=\'ui\', message=\'Check is in an invalid state\')\n
\n \n
line = transaction.get(\'movement\')\n line = transaction.get(\'movement\')\n
if line is not None and line.getPortalType() == \'Banking Operation Line\':\n if line is not None and line.getPortalType() == \'Banking Operation Line\':\n
...@@ -150,6 +152,7 @@ transaction.edit(aggregate = check.getRelativeUrl())\n ...@@ -150,6 +152,7 @@ transaction.edit(aggregate = check.getRelativeUrl())\n
<string>bank_account</string> <string>bank_account</string>
<string>check_number</string> <string>check_number</string>
<string>check</string> <string>check</string>
<string>ValidationError</string>
<string>line</string> <string>line</string>
<string>None</string> <string>None</string>
</tuple> </tuple>
......
...@@ -104,6 +104,8 @@ if len(check_list)>0:\n ...@@ -104,6 +104,8 @@ if len(check_list)>0:\n
\n \n
# Then we will construct a new line for each check\n # Then we will construct a new line for each check\n
for item in check_list:\n for item in check_list:\n
if not check.Check_isValid():\n
raise ValidationError, Message(domain=\'ui\', message=\'Check is in an invalid state\')\n
delivery_line = transaction.newContent(portal_type=\'Checkbook Delivery Line\')\n delivery_line = transaction.newContent(portal_type=\'Checkbook Delivery Line\')\n
item_dict = {}\n item_dict = {}\n
reference_range_min = None\n reference_range_min = None\n
...@@ -251,6 +253,8 @@ if debit_required:\n ...@@ -251,6 +253,8 @@ if debit_required:\n
<string>x</string> <string>x</string>
<string>id_list</string> <string>id_list</string>
<string>item</string> <string>item</string>
<string>check</string>
<string>ValidationError</string>
<string>delivery_line</string> <string>delivery_line</string>
<string>item_dict</string> <string>item_dict</string>
<string>reference_range_min</string> <string>reference_range_min</string>
......
99 100
\ 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