Commit 83fc8d8a authored by Sebastien Robin's avatar Sebastien Robin

fixed a few fields

call constraint checkers inside several workflows

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11733 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0128b1cc
......@@ -78,7 +78,7 @@
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addCashDelivery</string> </value>
<value> <string>addBankingOperation</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
......
<?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># first get the source of the document,\n
# we will need to add the counter\n
source = context.getSource()\n
baobab_source = None\n
context.log(\'baobab_source\', baobab_source)\n
# Get the history of the workflow\n
user_id=\'None\'\n
context.log(\'workflow_item_list:\',context.Base_getWorkflowHistoryItemList(\'check_payment_workflow\',display=0))\n
for workflow_item in context.Base_getWorkflowHistoryItemList(\'check_payment_workflow\',display=0):\n
context.log(\'workflow_item.getProperty(action)\',workflow_item.getProperty(\'action\'))\n
if workflow_item.getProperty(\'action\')==\'deliver_action\':\n
user_id=workflow_item.getProperty(\'actor\')\n
context.log(\'user_id\',user_id)\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
context.log(\'CheckPayment_getBaobabSource site_list\',site_list)\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n
context.log(\'site\', site)\n
if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
baobab_source = site + \'/encaisse_des_billets_et_monnaies/sortante\'\n
break\n
context.log(\'baobab_source\', baobab_source)\n
\n
\n
context.log(\'baobab_source\', baobab_source)\n
return baobab_source\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>**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>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>source</string>
<string>None</string>
<string>baobab_source</string>
<string>user_id</string>
<string>_getiter_</string>
<string>workflow_item</string>
<string>site_list</string>
<string>site</string>
<string>site_value</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>AccountIncident_getBaobabSource</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return context.Baobab_getPortalDefaultPaymentNode()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>**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>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</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>AccountIncident_getBaobabSourcePayment</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>total = 0\n
for line in context.objectValues(portal_type = context.getPortalAccountingMovementTypeList()) :\n
total += line.getSourceCredit()\n
\n
return total\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>total</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>line</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>AccountIncident_statSourceCredit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>total = 0\n
for line in context.objectValues(portal_type = context.getPortalAccountingMovementTypeList()) :\n
total += line.getSourceDebit()\n
\n
return total\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>total</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>line</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>AccountIncident_statSourceDebit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 encoding="cdata"><![CDATA[
# We will create a new account transfer and then copy most of local properties\n
# to the new account transfer created\n
request=context.REQUEST\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
edit_kw = {}\n
edit_kw[\'delivery_mode\'] = context.getDeliveryMode()\n
edit_kw[\'source_section\'] = context.getSourceSection()\n
edit_kw[\'source_payment\'] = context.getSourcePayment()\n
edit_kw[\'external_software\'] = context.getExternalSoftware()\n
edit_kw[\'posted\'] = context.getPosted()\n
edit_kw[\'description\'] = context.getDescription()\n
\n
new_transfer = context.account_transfer_module.newContent(**edit_kw)\n
\n
message = N_("Account Transfer duplicated.")\n
if not selection_index:\n
redirect_url = \'%s/%s?portal_status_message=%s\' % (new_transfer.absolute_url(),\n
form_id,\n
message)\n
else:\n
redirect_url = \'%s/%s?selection_index=%s&selection_name=%s&portal_status_message=%s\' % (\n
new_transfer.absolute_url(),\n
form_id,\n
selection_index,\n
selection_name,\n
message)\n
\n
return request[\'RESPONSE\'].redirect(redirect_url)\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>form_id, selection_index=0, selection_name=\'\', dialog_id=\'\', ignore_layout=None,**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>5</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>form_id</string>
<string>selection_index</string>
<string>selection_name</string>
<string>dialog_id</string>
<string>ignore_layout</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>portal</string>
<string>N_</string>
<string>edit_kw</string>
<string>_write_</string>
<string>_apply_</string>
<string>new_transfer</string>
<string>message</string>
<string>redirect_url</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<int>0</int>
<string></string>
<string></string>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountTransfer_duplicate</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -308,7 +308,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getVaultItemList(vault_type=[\'site/surface/banque_interne\', \'site/surface/operations_diverses\'], current_url=here.getSource(), user_site=1, leaf_node=0, strict_membership=1)</string> </value>
<value> <string>python:here.Delivery_getVaultItemList(vault_type=[\'site/surface/banque_interne\', \'site/surface/operations_diverses\', \'site/surface/gros_versement\'], current_url=here.getSource(), user_site=1, leaf_node=0, strict_membership=1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -308,7 +308,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getVaultItemList(vault_type=[\'site/surface/banque_interne\', \'site/surface/operations_diverses\'], current_url=here.getSource(), user_site=1, leaf_node=0, strict_membership=1)</string> </value>
<value> <string>python:here.Delivery_getVaultItemList(vault_type=[\'site/surface/banque_interne\', \'site/surface/operations_diverses\',\'site/surface/gros_paiement\'], current_url=here.getSource(), user_site=1, leaf_node=0, strict_membership=1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -281,7 +281,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.CurrencyExchange_getCurrencyList()</string> </value>
<value> <string>python: here.CurrencyExchange_getCurrencyList(exclude_reference_currency=1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -281,7 +281,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getVaultItemList(vault_type = \'site\', current_url = None, user_site = None, leaf_node = 0, strict_membership = 1)</string> </value>
<value> <string>python:here.Delivery_getVaultItemList(vault_type = \'site\', current_url = None, user_site = None, leaf_node = 0, strict_membership = 1,main_agency=1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -349,6 +349,10 @@
<string>cash_number_range_stop</string>
<string>End Number</string>
</tuple>
<tuple>
<string>date</string>
<string>Reception Date</string>
</tuple>
<tuple>
<string>resource_translated_title</string>
<string>Denomination</string>
......
......@@ -80,13 +80,13 @@ if listbox is None:\n
listbox = []\n
#context.log("tracking list", context.portal_simulation.getCurrentTrackingList(at_date= reference_date, node = node))\n
for o in context.portal_simulation.getCurrentTrackingList(at_date= reference_date, node = node):\n
if o.getObject().getParentValue().getPortalType() in container_portal_type_list:\n
cash_container = o.getObject()\n
if cash_container.getParentValue().getPortalType() in container_portal_type_list:\n
# get one line in order to know some properties of the cash container\n
container_dict = {}\n
container_lines = cash_container.searchFolder(portal_type=\'Container Line\')\n
if len(container_lines) == 0:\n
context.log("MonetaryIssue_generateCashContainerInputDialog", "No container line finf for cash container %s" %(cash_container.getRelativeUrl(),))\n
context.log("MonetaryIssue_generateCashContainerInputDialog", "No container line find for cash container %s" %(cash_container.getRelativeUrl(),))\n
continue\n
container_line = container_lines[0].getObject()\n
container_dict[\'reference\'] = cash_container.getReference()\n
......@@ -96,9 +96,18 @@ if listbox is None:\n
container_dict[\'quantity\'] = container_line.getQuantity()\n
container_dict[\'total_price\'] = container_line.getTotalPrice()\n
container_dict[\'selection\'] = 0\n
container_dict[\'date\'] = o.date\n
container_dict[\'uid\'] = \'new_%s\' %(cash_container.getUid(),) #cash_container.getReference().replace(\'/\', \'_\'),)\n
\n
listbox.append(container_dict)\n
\n
def sort_listbox(a,b):\n
result = cmp(a[\'date\'],b[\'date\'])\n
if result == 0:\n
result = cmp(a[\'reference\'],b[\'reference\'])\n
return result\n
\n
listbox.sort(sort_listbox)\n
\n
context.Base_updateDialogForm(listbox=listbox\n
)\n
......@@ -180,6 +189,7 @@ if listbox is None:\n
<string>_getitem_</string>
<string>container_line</string>
<string>_write_</string>
<string>sort_listbox</string>
<string>_apply_</string>
</tuple>
</value>
......
......@@ -445,6 +445,10 @@
<list/>
</value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
......@@ -486,7 +490,7 @@
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
<value> <string>monetary_reception_delivery_line_list_selection</string> </value>
</item>
<item>
<key> <string>sort</string> </key>
......
......@@ -71,7 +71,7 @@
<value> <string>destination = context.getDestination()\n
baobab_destination = None\n
# Get the history of the workflow\n
user_id=\'None\'\n
user_id=None\n
for workflow_item in context.Base_getWorkflowHistoryItemList(\'money_deposit_workflow\',display=0):\n
if workflow_item.getProperty(\'action\')==\'deliver_action\':\n
user_id=workflow_item.getProperty(\'actor\')\n
......@@ -81,6 +81,10 @@ for site in site_list:\n
if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n
baobab_destination = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
break\n
if user_id is not None and baobab_destination is None:\n
from Products.ERP5Type.Message import Message\n
message = Message(domain="ui", message="The owner is not assigned to the right vault.")\n
raise ValueError,message\n
return baobab_destination\n
</string> </value>
</item>
......@@ -149,6 +153,10 @@ return baobab_destination\n
<string>site_list</string>
<string>site</string>
<string>site_value</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>message</string>
<string>ValueError</string>
</tuple>
</value>
</item>
......
......@@ -287,7 +287,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getVaultItemList(vault_type=[\'site/surface/banque_interne\', \'site/surface/operations_diverses\', \'site/surface/gros_paiement\'], current_url=here.getSource(), user_site=1, leaf_node=0, strict_membership=1)</string> </value>
<value> <string>python:here.Delivery_getVaultItemList(vault_type=[\'site/surface/banque_interne\', \'site/surface/operations_diverses\', \'site/surface/gros_versement\'], current_url=here.getSource(), user_site=1, leaf_node=0, strict_membership=1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -287,7 +287,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Delivery_getVaultItemList(user_site=0,vault_type=(\'site\',),strict_membership=1,leaf_node=0,with_base=0)</string> </value>
<value> <string>python: here.Delivery_getVaultItemList(user_site=0,vault_type=(\'site\',),strict_membership=1,leaf_node=0,with_base=0,exclude_user_site=1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -89,7 +89,8 @@ elif len(in_list) == 0 and len(out_list) == 0:\n
msg = Message(domain = "ui", message="No resource.")\n
raise ValidationFailed, (msg,)\n
elif len(out_list) !=0:\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Outgoing Account Incident Line\')\n
#resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Outgoing Account Incident Line\')\n
resource = txn.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Outgoing Account Incident Line\')\n
if resource <> 0 :\n
msg = Message(domain="ui", message="Insufficient Balance.")\n
raise ValidationFailed, (msg,)\n
......@@ -162,7 +163,6 @@ elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != p
<string>out_price</string>
<string>len</string>
<string>msg</string>
<string>transaction</string>
<string>resource</string>
</tuple>
</value>
......
......@@ -73,6 +73,13 @@ from Products.ERP5Type.Message import Message\n
\n
# Purchase Transaction .\n
transaction = state_change.object\n
\n
# use of the constraint : Test if quantity is multiple of 1000\n
vliste = transaction.checkConsistency()\n
transaction.log(\'vliste\', vliste)\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getMessage(),)\n
\n
# Get inventory\n
vault = transaction.getSource()\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Incoming Cash Sorting Line\')\n
......@@ -152,6 +159,9 @@ elif resource != 0 :\n
<string>Message</string>
<string>_getattr_</string>
<string>transaction</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>vault</string>
<string>resource</string>
<string>price</string>
......
......@@ -108,7 +108,7 @@ context.BankingOperationLine_index(line)\n
bank_account.serialize()\n
\n
# Check if the banking operation is correct.\n
if - price != transaction.getTotalPrice(portal_type = \'Banking Operation Line\'):\n
if - price != transaction.getTotalPrice(portal_type = \'Banking Operation Line\',fast=0):\n
msg = Message(domain=\'ui\', message=\'Banking operation and currency sale price do not match.\')\n
raise ValidationFailed, (msg,)\n
\n
......
......@@ -58,7 +58,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Currency Sale Consistency</string> </value>
<value> <string>Control</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Currency Sale Consistency</string> </value>
<value> <string>Control</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
......@@ -58,7 +58,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Currency Sale Consistency</string> </value>
<value> <string>Control</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
......@@ -75,6 +75,12 @@ from Products.ERP5Type.Message import Message\n
\n
transaction = state_change.object\n
\n
# use of the constraint\n
vliste = transaction.checkConsistency()\n
transaction.log(\'vliste\', vliste)\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getMessage(),)\n
\n
vault = transaction.getSource()\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Monetary Issue Line\')\n
\n
......@@ -154,6 +160,9 @@ elif resource <> 0 :\n
<string>Message</string>
<string>_getattr_</string>
<string>transaction</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>vault</string>
<string>resource</string>
<string>amount</string>
......
......@@ -72,6 +72,14 @@
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
object = state_change.object\n
\n
# use of the constraint\n
vliste = object.checkConsistency()\n
object.log(\'vliste\', vliste)\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getMessage(),)\n
\n
\n
# first check if we have line defined\n
if len(object.objectValues(portal_type=\'Cash Delivery Line\')) == 0:\n
msg = Message(domain="ui", message="No line defined on document.")\n
......@@ -83,8 +91,11 @@ if \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\
raise ValidationFailed, (msg,)\n
\n
# check between letter and destination site codification\n
line_letter = object.objectValues(portal_type=\'Cash Delivery Line\')[0].objectValues()[0].getEmissionLetter()\n
if line_letter.lower() != dest.getCodification()[0].lower():\n
# Make sure objects are Banknotes\n
first_movement = object.Delivery_getMovementList(portal_type=[\'Cash Delivery Line\',\'Cash Delivery Cell\'])[0]\n
if first_movement.getResourceValue().getPortalType()==\'Banknote\':\n
line_letter = first_movement.getEmissionLetter()\n
if line_letter.lower() != dest.getCodification()[0].lower():\n
msg = Message(domain="ui", message="Letter defined on line do not correspond to destination site.")\n
raise ValidationFailed, (msg,)\n
</string> </value>
......@@ -142,10 +153,12 @@ if line_letter.lower() != dest.getCodification()[0].lower():\n
<string>ValidationFailed</string>
<string>_getattr_</string>
<string>object</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>msg</string>
<string>dest</string>
<string>_getitem_</string>
<string>first_movement</string>
<string>line_letter</string>
</tuple>
</value>
......
......@@ -90,11 +90,6 @@ elif resource == 2:\n
elif price != cash_detail:\n
msg = Message(domain="ui", message="Amount differs from input.")\n
raise ValidationFailed, (msg,)\n
"""\n
elif resource == 1:\n
msg = Message(domain="ui", message="Insufficient Balance in counter.")\n
raise ValidationFailed, (msg,)\n
"""\n
</string> </value>
</item>
<item>
......
......@@ -78,6 +78,12 @@ date = transaction.getStartDate()\n
vault = transaction.getSource()\n
vaultDestination = transaction.getDestination()\n
\n
# use of the constraint : Test source and destination\n
vliste = transaction.checkConsistency()\n
transaction.log(\'vliste\', vliste)\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getMessage(),)\n
\n
# check we are in an opened accounting day\n
if not transaction.Baobab_checkCounterDateOpen(site=vaultDestination, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n
......@@ -165,6 +171,9 @@ elif resource <> 0 :\n
<string>date</string>
<string>vault</string>
<string>vaultDestination</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>msg</string>
<string>resource</string>
<string>amount</string>
......
117
\ No newline at end of file
126
\ 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