diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Base_checkOrCreateCheck.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Base_checkOrCreateCheck.xml index d1da5563da07c5a2b57ab014775061f75980286b..0d2d4574fcd0b38a3bef585f5b02f926866c9e6a 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Base_checkOrCreateCheck.xml +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Base_checkOrCreateCheck.xml @@ -76,7 +76,6 @@ # 2 - if the end date is passed, we raise an error\n from Products.ERP5Type.Message import Message\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n -from DateTime import DateTime\n \n if destination:\n bank_account = context.getDestinationPaymentValue()\n @@ -125,10 +124,7 @@ for check_reference in reference_list:\n raise ValidationFailed, (msg,)\n result = context.portal_catalog(portal_type = \'Check\', reference = check_reference)\n if len(result) == 0:\n - # We will not allow creation of generic check after a particular date\n - end_date = DateTime(\'2009/01/01\')\n - now = DateTime()\n - if (now - end_date) >0:\n + if not context.Base_isAutomaticCheckCreationAllowed():\n msg = Message(domain = "ui", message="Sorry, this reference does not exist")\n raise ValidationFailed, (msg,)\n \n @@ -222,7 +218,6 @@ return check_list\n <string>Message</string> <string>Products.DCWorkflow.DCWorkflow</string> <string>ValidationFailed</string> - <string>DateTime</string> <string>_getattr_</string> <string>context</string> <string>bank_account</string> @@ -239,8 +234,6 @@ return check_list\n <string>message_tag</string> <string>result</string> <string>len</string> - <string>end_date</string> - <string>now</string> <string>checkbook</string> <string>_getitem_</string> <string>generic_model</string> diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Base_isAutomaticCheckCreationAllowed.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Base_isAutomaticCheckCreationAllowed.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b43598adf6da6d10dad7f26acb598d54f97a324 --- /dev/null +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Base_isAutomaticCheckCreationAllowed.xml @@ -0,0 +1,155 @@ +<?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> diff --git a/bt5/erp5_banking_check/bt/revision b/bt5/erp5_banking_check/bt/revision index 69226f7293aa543649b73a6ed3264cddabfcd8c1..c4fbb1cfac0ba7a86115b48a39b49daea09da15a 100644 --- a/bt5/erp5_banking_check/bt/revision +++ b/bt5/erp5_banking_check/bt/revision @@ -1 +1 @@ -92 \ No newline at end of file +97 \ No newline at end of file