Commit b584412d authored by Sebastien Robin's avatar Sebastien Robin

add constraint on bank account

sort banknote and coins on fast inputs

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11515 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e1ebcda4
......@@ -171,61 +171,61 @@
</value>
</item>
<item>
<key> <string>hasCellContent</string> </key>
<key> <string>getValidationState</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<key> <string>getValidationStateTitle</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>invoice_state</string> </key>
<key> <string>hasCellContent</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>meta_type</string> </key>
<key> <string>id</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>opportunity_state</string> </key>
<key> <string>invoice_state</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>payment_state</string> </key>
<key> <string>meta_type</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>security_uid</string> </key>
<key> <string>opportunity_state</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>uid</string> </key>
<key> <string>payment_state</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<key> <string>security_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>validation_state_title</string> </key>
<key> <string>uid</string> </key>
<value>
<dictionary/>
</value>
......@@ -254,8 +254,8 @@
<string>getSimulationStateTitle</string>
<string>causality_state</string>
<string>invoice_state</string>
<string>validation_state</string>
<string>validation_state_title</string>
<string>getValidationState</string>
<string>getValidationStateTitle</string>
<string>payment_state</string>
<string>event_state</string>
<string>getReference</string>
......@@ -303,8 +303,8 @@ getSimulationState\r\n
getSimulationStateTitle\r\n
causality_state\r\n
invoice_state\r\n
validation_state\r\n
validation_state_title\r\n
getValidationState\r\n
getValidationStateTitle\r\n
payment_state\r\n
event_state\r\n
getReference\r\n
......@@ -376,8 +376,8 @@ VALUES\n
<dtml-sqlvar expr="opportunity_state[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getCorporateRegistrationCode[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getEan13Code[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="validation_state[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="validation_state_title[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getValidationState[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getValidationStateTitle[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getSimulationState[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getSimulationStateTitle[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="causality_state[loop_item]" type="string" optional>,\n
......@@ -455,8 +455,8 @@ VALUES\n
<dtml-sqlvar expr="opportunity_state[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getCorporateRegistrationCode[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getEan13Code[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="validation_state[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="validation_state_title[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getValidationState[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getValidationStateTitle[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getSimulationState[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="getSimulationStateTitle[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="causality_state[loop_item]" type="string" optional>,\n
......
......@@ -5,6 +5,5 @@
<key>destination_uid | category,catalog/uid/z_related_default_destination</key>
<key>site_id | category,catalog/id/z_related_default_site</key>
<key>site_uid | category,catalog/uid/z_related_default_site</key>
<key>source_uid | category,catalog/uid/z_related_default_source</key>
<key>translated_simulation_state_title | translation/translated_message/z_related_translated_simulation_state_title</key>
</key_list>
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
# Sebastien Robin <seb@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Products.ERP5Type.Constraint import Constraint
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Cache import CachingMethod
from zLOG import LOG
class BankAccountReference(Constraint):
"""
This constraint checks that the bank account follow
the bceao settings (len of field) :
bank_country_code (1)
bank_code (4)
branch (5)
bank_account_number (12)
bank_account_key (2)
Configuration example:
{ 'id' : 'bank_account_reference',
'description' : 'bank properties must be correct',
'type' : 'BankAccountReference',
},
"""
def checkConsistency(self, obj, fixit=0):
"""
This is the check method, we return a list of string,
each string corresponds to an error.
"""
if not self._checkConstraintCondition(obj):
return []
errors = []
error_message = None
def checkLen(property,size):
value = obj.getProperty(property)
if value is None:
error_message = "%s is not defined" % property
errors.append(self._generateError(obj, error_message))
elif len(value) != size:
error_message = "%s must have a lenth of $size" % property
errors.append(self._generateError(obj, error_message,
mapping={'size':size}))
checkLen('bank_country_code',1)
checkLen('bank_code',4)
checkLen('branch',5)
checkLen('bank_account_number',12)
checkLen('bank_account_key',2)
return errors
<?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>def sortCurrencyCashList(currency_cash_list):\n
"""Sort a list of currency cash objects\n
"""\n
def sortLines(a_source, b_source):\n
"""This method helps sorting supported by Python\'s standard function.\n
"""\n
# Get the currency cash objects. They can be defined as resources.\n
if a_source.getPortalType() in (\'Coin\', \'Banknote\'):\n
a = a_source\n
b = b_source\n
else :\n
a = a_source.getResourceValue()\n
b = b_source.getResourceValue()\n
\n
# First, compare the base prices (such as 1000 and 2000 Francs CFA).\n
result = - cmp(a.getBasePrice(), b.getBasePrice())\n
if result != 0:\n
return result\n
\n
# Second, compare the portal types.\n
result = cmp(a.getPortalType(), b.getPortalType())\n
if result != 0:\n
return result\n
\n
# Last, compare the variations (such as the years 1994 and 2003).\n
result = cmp(a.getVariation(), b.getVariation())\n
return result\n
\n
currency_cash_list.sort(sortLines)\n
return currency_cash_list\n
\n
return sortCurrencyCashList(currency_cash_list)\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>currency_cash_list</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>currency_cash_list</string>
<string>sortCurrencyCashList</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_sortCurrencyCashList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -70,39 +70,6 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
def sortCurrencyCashList(currency_cash_list):\n
"""Sort a list of currency cash objects\n
"""\n
def sortLines(a_source, b_source):\n
"""This method helps sorting supported by Python\'s standard function.\n
"""\n
# Get the currency cash objects. They can be defined as resources.\n
if a_source.getPortalType() in (\'Coin\', \'Banknote\'):\n
a = a_source\n
b = b_source\n
else :\n
a = a.getResourceValue()\n
b = b.getResourceValue()\n
\n
# First, compare the portal types.\n
result = cmp(a.getPortalType(), b.getPortalType())\n
if result != 0:\n
return result\n
\n
# Second, compare the base prices (such as 1000 and 2000 Francs CFA).\n
result = cmp(a.getBasePrice(), b.getBasePrice())\n
if result != 0:\n
return result\n
\n
# Last, compare the variations (such as the years 1994 and 2003).\n
result = cmp(a.getVariation(), b.getVariation())\n
return result\n
\n
currency_cash_list.sort(sortLines)\n
return currency_cash_list\n
\n
\n
\n
# listbox is not passed at the first time when this script is called.\n
# when the user clicks on the Update button, listbox is passed, and\n
# the contents must be preserved in the form.\n
......@@ -156,7 +123,7 @@ if listbox is None:\n
new_currency_cash_list.append(currency_cash)\n
currency_cash_list = new_currency_cash_list\n
\n
currency_cash_list = sortCurrencyCashList(currency_cash_list)\n
currency_cash_list = context.Base_sortCurrencyCashList(currency_cash_list)\n
\n
# Get the axis information based on the specified column base category.\n
# axis_list_dict contains the lists of objects, while axis_dict contains\n
......@@ -451,7 +418,6 @@ else :\n
<string>listbox</string>
<string>cash_detail_dict</string>
<string>kw</string>
<string>sortCurrencyCashList</string>
<string>None</string>
<string>_getitem_</string>
<string>cash_status_list</string>
......
......@@ -278,27 +278,23 @@ for resource_id in per_resource_dict.keys():\n
else:\n
cell.setQuantity(variation_item["quantity"])\n
\n
request = context.REQUEST\n
N_ = context.Base_translateString\n
\n
if variation_not_defined:\n
old_line = [x.getObject() for x in context.objectValues(portal_type=[line_portal_type,])]\n
if len(old_line)>0:\n
for object_list in old_line:\n
context.deleteContent(object_list.getId())\n
request = context.REQUEST\n
N_ = context.Base_translateString\n
message = N_("$title doesn\'t exist for $variation", mapping = {\'title\':resource_object.getTranslatedTitle(), \'variation\':variation.lstrip(\'variation/\')})\n
redirect_url = \'%s/view?%s\' % ( context.absolute_url()\n
, "portal_status_message=%s" %message\n
)\n
request[ \'RESPONSE\' ].redirect( redirect_url )\n
else:\n
request_form = context.REQUEST.form\n
#request_form[\'pickle_string\'] = \'\'\n
#context.Base_updateDialogForm(pickle_string=\'\',portal_status_message=\'Lines Created\')\n
#main_form = getattr(context,form_id)\n
#return main_form(portal_status_message=\'Lines Created\')\n
request = context.REQUEST\n
message = N_("Lines Created")\n
redirect_url = \'%s/view?%s\' % ( context.absolute_url()\n
, \'portal_status_message=Lines Created\'\n
, \'portal_status_message=%s\' %(message,)\n
)\n
request[ \'RESPONSE\' ].redirect( redirect_url )\n
......@@ -426,12 +422,11 @@ else:\n
<string>mapped_value_list</string>
<string>variation_item</string>
<string>cell</string>
<string>object_list</string>
<string>request</string>
<string>N_</string>
<string>object_list</string>
<string>message</string>
<string>redirect_url</string>
<string>request_form</string>
</tuple>
</value>
</item>
......
......@@ -94,6 +94,7 @@ vault_inventory_dict = {}\n
\n
vault_url = vault\n
vault_dict[vault_url] = 1\n
total_inventory_list = []\n
\n
vault_inventory_dict[vault_url] = {}\n
inventory_kw = {}\n
......@@ -112,6 +113,10 @@ if kw.has_key("omit_output"):\n
inventory_kw[\'omit_output\'] = kw[\'omit_output\']\n
if kw.has_key("explanation_portal_type"):\n
inventory_kw[\'explanation_portal_type\'] = kw[\'explanation_portal_type\']\n
if kw.has_key("explanation_uid"):\n
inventory_kw[\'explanation_uid\'] = kw[\'explanation_uid\']\n
if len(kw[\'explanation_uid\'])==0:\n
return total_inventory_list\n
\n
if at_date is not None:\n
# XXX this make sure we look at the end of the day\n
......@@ -140,10 +145,10 @@ vault_inventory_list = context.portal_simulation.getCurrentInventoryList( node=v
, ignore_variation=0\n
,**inventory_kw\n
)\n
#context.log(\'CounterMOdule_getVaultTransactionList, sql src:\',context.portal_simulation.getCurrentInventoryList( node=vault\n
# , ignore_variation=0,src__=1\n
# ,**inventory_kw\n
# ))\n
context.log(\'CounterMOdule_getVaultTransactionList, sql src:\',context.portal_simulation.getCurrentInventoryList( node=vault\n
, ignore_variation=0,src__=1\n
,**inventory_kw\n
))\n
\n
#context.log(\'len(vault_inventory_list:\',len(vault_inventory_list))\n
for vault_inventory in vault_inventory_list:\n
......@@ -171,7 +176,6 @@ for vault_inventory in vault_inventory_list:\n
resource_dict[resource] = 1\n
\n
\n
total_inventory_list = []\n
\n
#context.log(\'resource_dict\',resource_dict)\n
#context.log(\'vault_inventory_dict\',vault_inventory_dict)\n
......@@ -312,10 +316,12 @@ return repr([x for x in total_inventory_list])\n
<string>vault_inventory_dict</string>
<string>vault_url</string>
<string>_write_</string>
<string>total_inventory_list</string>
<string>inventory_kw</string>
<string>None</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>len</string>
<string>column_list</string>
<string>_getiter_</string>
<string>_apply_</string>
......@@ -326,13 +332,11 @@ return repr([x for x in total_inventory_list])\n
<string>total_quantity</string>
<string>total_price</string>
<string>abs</string>
<string>total_inventory_list</string>
<string>i</string>
<string>variation_text</string>
<string>tmp_dict</string>
<string>variation</string>
<string>resource_value</string>
<string>len</string>
<string>movement</string>
<string>explanation_value</string>
<string>getattr</string>
......
......@@ -70,15 +70,19 @@
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Cache import CachingMethod\n
\n
def getCurrencyList():\n
def getCurrencyList(exclude_reference_currency=0):\n
currency_value_list = context.currency_module.objectValues()\n
if exclude_reference_currency:\n
reference_id = context.Baobab_getPortalReferenceCurrencyID()\n
currency_value_list = [x for x in currency_value_list if x.getId() != reference_id]\n
currency_list = [(\'%s - %s\' % (x.getReference(), x.getTitle()), x.getRelativeUrl())\n
for x in context.currency_module.objectValues()]\n
for x in currency_value_list]\n
\n
currency_list.insert(0, (\'\',\'\'))\n
return currency_list\n
\n
getCurrencyList = CachingMethod(getCurrencyList, id = \'CurrencyExchange_getCurrencyList\', cache_duration = 3600)\n
return getCurrencyList()\n
return getCurrencyList(exclude_reference_currency=exclude_reference_currency)\n
</string> </value>
</item>
<item>
......@@ -107,7 +111,7 @@ return getCurrencyList()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>exclude_reference_currency=0</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -127,12 +131,13 @@ return getCurrencyList()\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>exclude_reference_currency</string>
<string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string>
<string>getCurrencyList</string>
......@@ -147,7 +152,9 @@ return getCurrencyList()\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<int>0</int>
</tuple>
</value>
</item>
<item>
......
......@@ -98,6 +98,8 @@ for line in line_list:\n
cell_type = portal_type[1]\n
cell_list.extend(list(line.objectValues(portal_type=cell_type)))\n
\n
cell_list = context.Base_sortCurrencyCashList(cell_list)\n
\n
return cell_list\n
</string> </value>
</item>
......
......@@ -68,7 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># vault_type = None : D\xc3\xa9finit les vaut_types \xc3\xa0 afficher,\n
<value> <string encoding="cdata"><![CDATA[
# vault_type = None : D\xc3\xa9finit les vaut_types \xc3\xa0 afficher,\n
# si valeur est None on r\xc3\xa9cup\xc3\xa8re vault_type\n
# depuis les sites auxquels est assign\xc3\xa9 l\'user\n
# exclude_vault_type = None : D\xc3\xa9finit les vaut_types \xc3\xa0 exclure,\n
......@@ -80,6 +82,7 @@
# au lieu des encaisses de tous le sites\n
# owner_site = 1 : Permet de s\xc3\xa9lectionner uniquement les encaisses des sites auquels le propri\xc3\xa9taire du document est affect\xc3\xa9,\n
# au lieu des encaisses de tous le sites\n
# main_agency = 0 : Permet de s\xc3\xa9lectionner uniquement les encaisses des sites qui appartiennent \xe0 une agence principale,\n
# leaf_node = 1 : S\xc3\xa9lectionne uniquement les noeuds qui sont des feuilles de l\'arbre (qui n\'ont pas de sous-cat\xc3\xa9gories)\n
# strict_membership = 0 : Appartenance stricte. Si vault_type=\'site\', on s\xc3\xa9lectionnera \'site/agence/principale/paris\',\n
# mais pas \'site/agence/principale/paris/caveau\', \'site/agence/principale/paris/surface\' et\n
......@@ -94,7 +97,7 @@ from Products.ERP5Type.Cache import CachingMethod\n
\n
def getVaultItemList(vault_type=None, exclude_vault_type=None,\n
user_site=1, leaf_node=1, strict_membership=0, assignment_list=None, \n
site_list=None, with_base=1, all=0, first_level=0):\n
site_list=None, with_base=1, all=0, first_level=0,main_agency=0):\n
\n
if vault_type is None:\n
organisation_list = []\n
......@@ -153,6 +156,9 @@ def getVaultItemList(vault_type=None, exclude_vault_type=None,\n
for site_member in site_member_list:\n
site_member_object = site_member.getObject()\n
site_member_relative_url = site_member_object.getRelativeUrl()\n
if main_agency:\n
if site_member_relative_url.find(\'principale\')<0:\n
continue\n
for exclude_vault_type_item in exclude_vault_type:\n
if is_member_of(site_member_object, exclude_vault_type_item, strict=0) :\n
break\n
......@@ -229,7 +235,7 @@ else:\n
vault_list = getVaultItemList(vault_type=vault_type, exclude_vault_type=exclude_vault_type,\n
user_site=user_site, leaf_node=leaf_node, strict_membership=strict_membership,\n
assignment_list=assignment_list, site_list=site_list, with_base=with_base, all=all,\n
first_level=first_level)\n
first_level=first_level,main_agency=main_agency)\n
\n
if current_url != None :\n
if \'site\' not in current_url:\n
......@@ -244,7 +250,9 @@ if current_url != None :\n
else :\n
return [(\'\', \'\'), (context.Localizer.erp5_ui.gettext(\'Unknown Vault\')+\' : %s\' % current_url, current_url)] + list(vault_list)\n
return [(\'\', \'\')] + list(vault_list)\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -272,7 +280,7 @@ return [(\'\', \'\')] + list(vault_list)\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>vault_type=None, exclude_vault_type=None, current_url=None, user_site=1, leaf_node=1, strict_membership=0, with_base=1, all=0, base_site=None, owner_site=0,first_level=0</string> </value>
<value> <string>vault_type=None, exclude_vault_type=None, current_url=None, user_site=1, leaf_node=1, strict_membership=0, with_base=1, all=0, base_site=None, owner_site=0,first_level=0,main_agency=0</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -300,7 +308,7 @@ return [(\'\', \'\')] + list(vault_list)\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>11</int> </value>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -317,6 +325,7 @@ return [(\'\', \'\')] + list(vault_list)\n
<string>base_site</string>
<string>owner_site</string>
<string>first_level</string>
<string>main_agency</string>
<string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string>
<string>None</string>
......@@ -361,6 +370,7 @@ return [(\'\', \'\')] + list(vault_list)\n
<none/>
<int>0</int>
<int>0</int>
<int>0</int>
</tuple>
</value>
</item>
......
<?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>from Products.ERP5Type.Message import Message\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
bank_account = state_change[\'object\']\n
\n
# use of the constraint\n
vliste = bank_account.checkConsistency()\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getTranslatedMessage(),)\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>_params</string> </key>
<value> <string>state_change, **kw</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getitem_</string>
<string>bank_account</string>
<string>_getattr_</string>
<string>vliste</string>
<string>len</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>checkBankAccount</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
<value> <string>checkBankAccount</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
<value> <string>checkBankAccount</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Variables</string>
<string>VariableDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_expr</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>action</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>transition/getId|nothing</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Variables</string>
<string>VariableDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_expr</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>actor</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getUserName</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Variables</string>
<string>VariableDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_expr</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>comment</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\',\'\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Variables</string>
<string>VariableDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_expr</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>portal_type</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Variables</string>
<string>VariableDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_expr</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>time</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
61
\ No newline at end of file
65
\ No newline at end of file
......@@ -4,5 +4,4 @@ translated_simulation_state_title | translation/translated_message/z_related_tra
site_id | category,catalog/id/z_related_default_site
destination_payment_title | category,catalog/title/z_related_destination_payment
destination_payment_id | category,catalog/id/z_related_destination_payment
source_uid | category,catalog/uid/z_related_default_source
destination_uid | category,catalog/uid/z_related_default_destination
\ 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