Commit 5bf2de46 authored by Vincent Pelletier's avatar Vincent Pelletier

Remove hardcoded date for automatic check creation and create a generic script...

Remove hardcoded date for automatic check creation and create a generic script (then locally overridable) to do the actual choice.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13309 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 38d09ab1
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
# 2 - if the end date is passed, we raise an error\n # 2 - if the end date is passed, we raise an error\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from DateTime import DateTime\n
\n \n
if destination:\n if destination:\n
bank_account = context.getDestinationPaymentValue()\n bank_account = context.getDestinationPaymentValue()\n
...@@ -125,10 +124,7 @@ for check_reference in reference_list:\n ...@@ -125,10 +124,7 @@ for check_reference in reference_list:\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
result = context.portal_catalog(portal_type = \'Check\', reference = check_reference)\n result = context.portal_catalog(portal_type = \'Check\', reference = check_reference)\n
if len(result) == 0:\n if len(result) == 0:\n
# We will not allow creation of generic check after a particular date\n if not context.Base_isAutomaticCheckCreationAllowed():\n
end_date = DateTime(\'2009/01/01\')\n
now = DateTime()\n
if (now - end_date) >0:\n
msg = Message(domain = "ui", message="Sorry, this reference does not exist")\n msg = Message(domain = "ui", message="Sorry, this reference does not exist")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
...@@ -222,7 +218,6 @@ return check_list\n ...@@ -222,7 +218,6 @@ return check_list\n
<string>Message</string> <string>Message</string>
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>DateTime</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>bank_account</string> <string>bank_account</string>
...@@ -239,8 +234,6 @@ return check_list\n ...@@ -239,8 +234,6 @@ return check_list\n
<string>message_tag</string> <string>message_tag</string>
<string>result</string> <string>result</string>
<string>len</string> <string>len</string>
<string>end_date</string>
<string>now</string>
<string>checkbook</string> <string>checkbook</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>generic_model</string> <string>generic_model</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># This script must be overloaded to allow automatic creation of checks.\n
# A use case for this functionnality is to cover the transition time between\n
# initial site installation and the time all processed checks a re supposed\n
# to be known to the system beforehand, ie emitted during the site lifespan.\n
\n
# Return True is the creation is allowed.\n
# Return False otherwise.\n
return False\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>False</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_isAutomaticCheckCreationAllowed</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
92 97
\ 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