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 @@ ...@@ -78,7 +78,7 @@
</item> </item>
<item> <item>
<key> <string>factory</string> </key> <key> <string>factory</string> </key>
<value> <string>addCashDelivery</string> </value> <value> <string>addBankingOperation</string> </value>
</item> </item>
<item> <item>
<key> <string>filter_content_types</string> </key> <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 @@ ...@@ -308,7 +308,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -349,6 +349,10 @@ ...@@ -349,6 +349,10 @@
<string>cash_number_range_stop</string> <string>cash_number_range_stop</string>
<string>End Number</string> <string>End Number</string>
</tuple> </tuple>
<tuple>
<string>date</string>
<string>Reception Date</string>
</tuple>
<tuple> <tuple>
<string>resource_translated_title</string> <string>resource_translated_title</string>
<string>Denomination</string> <string>Denomination</string>
......
...@@ -80,13 +80,13 @@ if listbox is None:\n ...@@ -80,13 +80,13 @@ if listbox is None:\n
listbox = []\n listbox = []\n
#context.log("tracking list", context.portal_simulation.getCurrentTrackingList(at_date= reference_date, node = node))\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 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
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 # get one line in order to know some properties of the cash container\n
container_dict = {}\n container_dict = {}\n
container_lines = cash_container.searchFolder(portal_type=\'Container Line\')\n container_lines = cash_container.searchFolder(portal_type=\'Container Line\')\n
if len(container_lines) == 0:\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 continue\n
container_line = container_lines[0].getObject()\n container_line = container_lines[0].getObject()\n
container_dict[\'reference\'] = cash_container.getReference()\n container_dict[\'reference\'] = cash_container.getReference()\n
...@@ -96,9 +96,18 @@ if listbox is None:\n ...@@ -96,9 +96,18 @@ if listbox is None:\n
container_dict[\'quantity\'] = container_line.getQuantity()\n container_dict[\'quantity\'] = container_line.getQuantity()\n
container_dict[\'total_price\'] = container_line.getTotalPrice()\n container_dict[\'total_price\'] = container_line.getTotalPrice()\n
container_dict[\'selection\'] = 0\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 container_dict[\'uid\'] = \'new_%s\' %(cash_container.getUid(),) #cash_container.getReference().replace(\'/\', \'_\'),)\n
\n \n
listbox.append(container_dict)\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 \n
context.Base_updateDialogForm(listbox=listbox\n context.Base_updateDialogForm(listbox=listbox\n
)\n )\n
...@@ -180,6 +189,7 @@ if listbox is None:\n ...@@ -180,6 +189,7 @@ if listbox is None:\n
<string>_getitem_</string> <string>_getitem_</string>
<string>container_line</string> <string>container_line</string>
<string>_write_</string> <string>_write_</string>
<string>sort_listbox</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
</value> </value>
......
...@@ -445,6 +445,10 @@ ...@@ -445,6 +445,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
...@@ -486,7 +490,7 @@ ...@@ -486,7 +490,7 @@
</item> </item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string></string> </value> <value> <string>monetary_reception_delivery_line_list_selection</string> </value>
</item> </item>
<item> <item>
<key> <string>sort</string> </key> <key> <string>sort</string> </key>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<value> <string>destination = context.getDestination()\n <value> <string>destination = context.getDestination()\n
baobab_destination = None\n baobab_destination = None\n
# Get the history of the workflow\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 for workflow_item in context.Base_getWorkflowHistoryItemList(\'money_deposit_workflow\',display=0):\n
if workflow_item.getProperty(\'action\')==\'deliver_action\':\n if workflow_item.getProperty(\'action\')==\'deliver_action\':\n
user_id=workflow_item.getProperty(\'actor\')\n user_id=workflow_item.getProperty(\'actor\')\n
...@@ -81,6 +81,10 @@ for site in site_list:\n ...@@ -81,6 +81,10 @@ for site in site_list:\n
if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n
baobab_destination = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n baobab_destination = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
break\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 return baobab_destination\n
</string> </value> </string> </value>
</item> </item>
...@@ -149,6 +153,10 @@ return baobab_destination\n ...@@ -149,6 +153,10 @@ return baobab_destination\n
<string>site_list</string> <string>site_list</string>
<string>site</string> <string>site</string>
<string>site_value</string> <string>site_value</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>message</string>
<string>ValueError</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -89,7 +89,8 @@ elif len(in_list) == 0 and len(out_list) == 0:\n ...@@ -89,7 +89,8 @@ elif len(in_list) == 0 and len(out_list) == 0:\n
msg = Message(domain = "ui", message="No resource.")\n msg = Message(domain = "ui", message="No resource.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
elif len(out_list) !=0:\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 if resource <> 0 :\n
msg = Message(domain="ui", message="Insufficient Balance.")\n msg = Message(domain="ui", message="Insufficient Balance.")\n
raise ValidationFailed, (msg,)\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 ...@@ -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>out_price</string>
<string>len</string> <string>len</string>
<string>msg</string> <string>msg</string>
<string>transaction</string>
<string>resource</string> <string>resource</string>
</tuple> </tuple>
</value> </value>
......
...@@ -73,6 +73,13 @@ from Products.ERP5Type.Message import Message\n ...@@ -73,6 +73,13 @@ from Products.ERP5Type.Message import Message\n
\n \n
# Purchase Transaction .\n # Purchase Transaction .\n
transaction = state_change.object\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 # Get inventory\n
vault = transaction.getSource()\n vault = transaction.getSource()\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Incoming Cash Sorting Line\')\n resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Incoming Cash Sorting Line\')\n
...@@ -152,6 +159,9 @@ elif resource != 0 :\n ...@@ -152,6 +159,9 @@ elif resource != 0 :\n
<string>Message</string> <string>Message</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>transaction</string> <string>transaction</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>vault</string> <string>vault</string>
<string>resource</string> <string>resource</string>
<string>price</string> <string>price</string>
......
...@@ -108,7 +108,7 @@ context.BankingOperationLine_index(line)\n ...@@ -108,7 +108,7 @@ context.BankingOperationLine_index(line)\n
bank_account.serialize()\n bank_account.serialize()\n
\n \n
# Check if the banking operation is correct.\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 msg = Message(domain=\'ui\', message=\'Banking operation and currency sale price do not match.\')\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Currency Sale Consistency</string> </value> <value> <string>Control</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</item> </item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Currency Sale Consistency</string> </value> <value> <string>Control</string> </value>
</item> </item>
<item> <item>
<key> <string>actbox_url</string> </key> <key> <string>actbox_url</string> </key>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Currency Sale Consistency</string> </value> <value> <string>Control</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
...@@ -75,6 +75,12 @@ from Products.ERP5Type.Message import Message\n ...@@ -75,6 +75,12 @@ from Products.ERP5Type.Message import Message\n
\n \n
transaction = state_change.object\n transaction = state_change.object\n
\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 vault = transaction.getSource()\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Monetary Issue Line\')\n resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Monetary Issue Line\')\n
\n \n
...@@ -154,6 +160,9 @@ elif resource <> 0 :\n ...@@ -154,6 +160,9 @@ elif resource <> 0 :\n
<string>Message</string> <string>Message</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>transaction</string> <string>transaction</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>vault</string> <string>vault</string>
<string>resource</string> <string>resource</string>
<string>amount</string> <string>amount</string>
......
...@@ -72,6 +72,14 @@ ...@@ -72,6 +72,14 @@
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n \n
object = state_change.object\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 # first check if we have line defined\n
if len(object.objectValues(portal_type=\'Cash Delivery Line\')) == 0:\n if len(object.objectValues(portal_type=\'Cash Delivery Line\')) == 0:\n
msg = Message(domain="ui", message="No line defined on document.")\n msg = Message(domain="ui", message="No line defined on document.")\n
...@@ -83,10 +91,13 @@ if \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\ ...@@ -83,10 +91,13 @@ if \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
# check between letter and destination site codification\n # check between letter and destination site codification\n
line_letter = object.objectValues(portal_type=\'Cash Delivery Line\')[0].objectValues()[0].getEmissionLetter()\n # Make sure objects are Banknotes\n
if line_letter.lower() != dest.getCodification()[0].lower():\n first_movement = object.Delivery_getMovementList(portal_type=[\'Cash Delivery Line\',\'Cash Delivery Cell\'])[0]\n
msg = Message(domain="ui", message="Letter defined on line do not correspond to destination site.")\n if first_movement.getResourceValue().getPortalType()==\'Banknote\':\n
raise ValidationFailed, (msg,)\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> </string> </value>
</item> </item>
<item> <item>
...@@ -142,10 +153,12 @@ if line_letter.lower() != dest.getCodification()[0].lower():\n ...@@ -142,10 +153,12 @@ if line_letter.lower() != dest.getCodification()[0].lower():\n
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>object</string> <string>object</string>
<string>vliste</string>
<string>len</string> <string>len</string>
<string>_getitem_</string>
<string>msg</string> <string>msg</string>
<string>dest</string> <string>dest</string>
<string>_getitem_</string> <string>first_movement</string>
<string>line_letter</string> <string>line_letter</string>
</tuple> </tuple>
</value> </value>
......
...@@ -90,11 +90,6 @@ elif resource == 2:\n ...@@ -90,11 +90,6 @@ elif resource == 2:\n
elif price != cash_detail:\n elif price != cash_detail:\n
msg = Message(domain="ui", message="Amount differs from input.")\n msg = Message(domain="ui", message="Amount differs from input.")\n
raise ValidationFailed, (msg,)\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> </string> </value>
</item> </item>
<item> <item>
......
...@@ -78,6 +78,12 @@ date = transaction.getStartDate()\n ...@@ -78,6 +78,12 @@ date = transaction.getStartDate()\n
vault = transaction.getSource()\n vault = transaction.getSource()\n
vaultDestination = transaction.getDestination()\n vaultDestination = transaction.getDestination()\n
\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 # check we are in an opened accounting day\n
if not transaction.Baobab_checkCounterDateOpen(site=vaultDestination, date=date):\n if not transaction.Baobab_checkCounterDateOpen(site=vaultDestination, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n msg = Message(domain = "ui", message="Counter Date is not opened")\n
...@@ -165,6 +171,9 @@ elif resource <> 0 :\n ...@@ -165,6 +171,9 @@ elif resource <> 0 :\n
<string>date</string> <string>date</string>
<string>vault</string> <string>vault</string>
<string>vaultDestination</string> <string>vaultDestination</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>msg</string> <string>msg</string>
<string>resource</string> <string>resource</string>
<string>amount</string> <string>amount</string>
......
117 126
\ 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