Commit 6887be13 authored by Sebastien Robin's avatar Sebastien Robin

many minor changes (workflow, consistency checking, check counter date, security settings)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12690 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5a45a355
......@@ -42,7 +42,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>print_pdf</string> </value>
<value> <string>print</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
......
......@@ -58,7 +58,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Impression</string> </value>
<value> <string>Print</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......
......@@ -459,6 +459,10 @@
<list/>
</value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
......@@ -496,7 +500,7 @@
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>account_incident_module_selection</string> </value>
<value> <string>account_incident_module_account_selection</string> </value>
</item>
<item>
<key> <string>sort</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 encoding="cdata"><![CDATA[
user_site_list = context.Baobab_getUserAssignedSiteList()\n
if len(user_site_list)>0:\n
site = context.Baobab_getVaultSite(user_site_list[0])\n
site_url = site.getRelativeUrl()\n
context.setSite(site_url)\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>**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>user_site_list</string>
<string>len</string>
<string>_getitem_</string>
<string>site</string>
<string>site_url</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>AccountTransfer_init</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -308,7 +308,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getVaultItemList(current_url=here.getSource(), vault_type=(\'site/surface\', \'site/caveau\'), all=1)</string> </value>
<value> <string>python:here.Base_sortItemList(here.Delivery_getVaultItemList(current_url=here.getSource(), vault_type=(\'site/surface\', \'site/caveau\'), all=1)+here.Delivery_getVaultItemList(vault_type = (\'site/caveau/auxiliaire/encaisse_des_externes\',),user_site=1,strict_membership=1,leaf_node=0))</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>reference_currency = context.Baobab_getPortalReferenceCurrencyID()\n
context.setPriceCurrency(\'currency_module/%s\' %(reference_currency,))\n
context.setCurrencyExchangeType(\'incident\')\n
\n
transaction = context\n
\n
# XXX it might be better to set resource according to source_payment.\n
#transaction.setResource(\'currency_module/\' + context.Baobab_getPortalReferenceCurrencyID())\n
\n
movement = transaction.newContent(portal_type=\'Banking Operation Line\',\n
id=\'movement\',\n
source=\'account_module/bank_account\', # Set default source\n
destination=\'account_module/bank_account\', # Set default destination\n
)\n
# Source and destination will be updated automaticaly based on the category of bank account\n
# The default account chosen should act as some kind of *temp* account or *parent* account\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>*args, **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>args</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>reference_currency</string>
<string>transaction</string>
<string>movement</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>CashIncident_init</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -281,7 +281,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getVaultItemList(current_url=here.getSource(), all=1, vault_type=(\'site/surface/banque_interne\',\'site/surface/gros_paiement\',\'site/surface/operations_diverses\'))</string> </value>
<value> <string>python:here.Delivery_getVaultItemList(current_url=here.getSource(), all=1, vault_type=(\'site/surface/banque_interne\',\'site/surface/gros_paiement\',\'site/surface/operations_diverses\'),user_vault=1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -71,25 +71,16 @@
<value> <string>if context.getSource() is None:\n
return None\n
\n
# must use owner to know site letter\n
#old_group_list = context.get_local_roles()\n
#for group, role_list in old_group_list:\n
# if \'Owner\' in role_list:\n
# user = group\n
\n
site_letter = context.getSourceValue().getCodification()[0].lower()\n
#site_letter = context.Baobab_getUserEmissionLetterList(user)\n
site = context.Baobab_getVaultSite(context.getSource()).getRelativeUrl()\n
\n
if context.getCashStatus() == \'to_sort\' or context.getCashStatus() == \'cancelled\' and context.getEmissionLetter() in site_letter:\n
# remaining banknote which are not sorted yet, or cancelled one\n
if not \'ventilation\' in context.getSource():\n
return \'%s/caveau/auxiliaire/encaisse_des_billets_et_monnaies\' %(site,)\n
else:\n
# take classification into account here\n
source_list = context.getSource().split(\'/\')\n
return \'%s/caveau/auxiliaire/%s\' %(site,\'/\'.join(source_list[-2:]))\n
elif context.getEmissionLetter() in site_letter:\n
emission_letter = context.getEmissionLetter()\n
if emission_letter!=\'not_defined\' and not (emission_letter in site_letter):\n
return \'%s/caveau/auxiliaire/encaisse_des_externes\' %(site,)\n
elif context.getCashStatus() == \'to_sort\' or context.getCashStatus() == \'cancelled\' and emission_letter in site_letter:\n
return \'%s/caveau/auxiliaire/encaisse_des_billets_et_monnaies\' %(site,)\n
\n
elif emission_letter in site_letter:\n
return \'%s/caveau/reserve/encaisse_des_billets_et_monnaies\' %(site,)\n
else:\n
return \'%s/caveau/auxiliaire/encaisse_des_externes\' %(site,)\n
......@@ -149,7 +140,7 @@ else:\n
<string>_getitem_</string>
<string>site_letter</string>
<string>site</string>
<string>source_list</string>
<string>emission_letter</string>
</tuple>
</value>
</item>
......
......@@ -82,8 +82,8 @@ if currency != context.Baobab_getPortalReferenceCurrencyID():\n
emission_letter = [\'not_defined\']\n
variation = [\'not_defined\']\n
else:\n
cash_status = None\n
emission_letter = None\n
cash_status = [\'valid\',\'new_emitted\']\n
emission_letter = [\'not_defined\'] + context.Baobab_getUserEmissionLetterList()\n
variation = context.Baobab_getResourceVintageList(banknote=1, coin=1)\n
\n
cash_detail_dict = {\'line_portal_type\' : \'Cash Delivery Line\'\n
......
......@@ -32,6 +32,12 @@
<key> <string>id</string> </key>
<value> <string>confirmed</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Confirmed</string> </value>
......@@ -56,4 +62,64 @@
</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>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -64,7 +64,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Validate</string> </value>
<value> <string>Deliver</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
......@@ -64,7 +64,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Deliver Action</string> </value>
<value> <string>Deliver</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
......@@ -83,11 +83,6 @@ caisse_outgoing = counter_site + encaisse_billets_et_monnaies_sortante\n
\n
\n
\n
# check again that we are in the good accounting date\n
if not transaction.Baobab_checkCounterDateOpen(site=counter_site, date=transaction.getStartDate()):\n
msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
raise ValidationFailed, (msg,)\n
\n
\n
\n
resource_two = transaction.CashDelivery_checkCounterInventory(caisse_outgoing, portal_type=\'Outgoing Cash Exchange Line\')\n
......@@ -176,11 +171,11 @@ if amount_total != outgoing_total:\n
<string>counter_site</string>
<string>caisse_incoming</string>
<string>caisse_outgoing</string>
<string>msg</string>
<string>resource_two</string>
<string>incoming_total</string>
<string>outgoing_total</string>
<string>amount_total</string>
<string>msg</string>
</tuple>
</value>
</item>
......
......@@ -64,7 +64,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Delivered Action</string> </value>
<value> <string>Deliver</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
......@@ -73,13 +73,14 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
txn = state_change[\'object\']\n
in_list = txn.searchFolder(portal_type=\'Incoming Cash Incident Line\')\n
out_list = txn.searchFolder(portal_type=\'Outgoing Cash Incident Line\')\n
in_list = txn.objectValues(portal_type=\'Incoming Cash Incident Line\')\n
out_list = txn.objectValues(portal_type=\'Outgoing Cash Incident Line\')\n
\n
price = txn.getSourceTotalAssetPrice()\n
in_price = txn.getTotalPrice(portal_type=[\'Incoming Cash Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
out_price = txn.getTotalPrice(portal_type=[\'Outgoing Cash Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
\n
\n
if len(in_list) != 0 and len(out_list) != 0:\n
msg = Message(domain = "ui", message="You can\'t have excess and deficit on the document.")\n
raise ValidationFailed, (msg,)\n
......
......@@ -82,6 +82,11 @@ vaultDestination = transaction.getDestination()\n
portal_type_with_no_space = transaction.getPortalType().replace(\' \',\'\')\n
check_path_script = getattr(transaction,\'%s_checkPath\' % portal_type_with_no_space,None)\n
\n
# check again that we are in the good accounting date\n
if not transaction.Baobab_checkCounterDateOpen(site=vault, date=transaction.getStartDate()):\n
msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
raise ValidationFailed, (msg,)\n
\n
if check_path_script is not None:\n
message = check_path_script()\n
transaction.log(\'check_path_script\',\'found\')\n
......@@ -162,11 +167,11 @@ elif resource <> 0 :\n
<string>getattr</string>
<string>None</string>
<string>check_path_script</string>
<string>msg</string>
<string>message</string>
<string>resource</string>
<string>amount</string>
<string>total_price</string>
<string>msg</string>
</tuple>
</value>
</item>
......
......@@ -73,19 +73,21 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
txn = state_change[\'object\']\n
in_list = txn.searchFolder(portal_type=\'Incoming Cash Sorting Incident Line\')\n
out_list = txn.searchFolder(portal_type=\'Outgoing Cash Sorting Incident Line\')\n
in_list = txn.objectValues(portal_type=\'Incoming Cash Sorting Incident Line\')\n
out_list = txn.objectValues(portal_type=\'Outgoing Cash Sorting Incident Line\')\n
\n
price = txn.getSourceTotalAssetPrice()\n
in_price = txn.getTotalPrice(portal_type=[\'Incoming Cash Sorting Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
out_price = txn.getTotalPrice(portal_type=[\'Outgoing Cash Sorting Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
\n
\n
if len(in_list) != 0 and len(out_list) != 0:\n
msg = Message(domain = "ui", message="You can\'t have excess and deficit on the document.")\n
raise ValidationFailed, (msg,)\n
elif len(in_list) == 0 and len(out_list) == 0:\n
msg = Message(domain = "ui", message="No resource.")\n
raise ValidationFailed, (msg,)\n
\n
elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != price):\n
msg = Message(domain = "ui", message="Price differs between document and resource.")\n
raise ValidationFailed, (msg,)\n
......
<?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.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
transaction = state_change[\'object\']\n
# Compute the source form the vault choosen by\n
# the accountant and find the counter with the\n
# user logged in\n
user_id = transaction.portal_membership.getAuthenticatedMember().getUserName()\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
# context.log(\'validateVaultBalance site_list\',site_list)\n
source = transaction.getSource()\n
baobab_source = None\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(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
source = baobab_source\n
source_object = context.portal_categories.getCategoryValue(source)\n
\n
# check again that we are in the good accounting date\n
if not transaction.Baobab_checkCounterDateOpen(site=source_object, date=transaction.getStartDate()):\n
msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
raise ValidationFailed, (msg,)\n
\n
resource = transaction.CashDelivery_checkCounterInventory(source = source, portal_type=\'Cash Delivery Line\', same_source=1)\n
#transaction.log("call to CashDelivery_getCounterInventory return", resource)\n
\n
# Get price and total_price.\n
price = transaction.getSourceTotalAssetPrice()\n
cash_detail = transaction.getTotalPrice(portal_type = (\'Cash Delivery Line\',\'Cash Delivery Cell\'), fast=0)\n
#transaction.log("price vs cash detail", str((price, cash_detail)))\n
if resource == 3:\n
msg = Message(domain="ui", message="No banknote or coin defined.")\n
raise ValidationFailed, (msg,)\n
elif resource == 2:\n
msg = Message(domain="ui", message="No resource defined.")\n
raise ValidationFailed, (msg,)\n
elif price != cash_detail:\n
msg = Message(domain="ui", message="Amount differs from input.")\n
raise ValidationFailed, (msg,)\n
elif resource == 1:\n
msg = Message(domain="ui", message="Insufficient Balance in counter.")\n
raise ValidationFailed, (msg,)\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>state_change</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>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getitem_</string>
<string>transaction</string>
<string>_getattr_</string>
<string>user_id</string>
<string>context</string>
<string>site_list</string>
<string>source</string>
<string>None</string>
<string>baobab_source</string>
<string>_getiter_</string>
<string>site</string>
<string>site_value</string>
<string>source_object</string>
<string>msg</string>
<string>resource</string>
<string>price</string>
<string>cash_detail</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>validateVaultBalance</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.DCWorkflow.States</string>
<string>StateDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>archived</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Delivered</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>cancel</string>
<string>cancel_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>type_list</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>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -40,8 +40,8 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>archive</string>
<string>post_dialog_action</string>
<string>deliver</string>
<string>deliver_action</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.States</string>
<string>StateDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>delivered</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -46,11 +46,11 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>archive</string> </value>
<value> <string>deliver</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>archived</string> </value>
<value> <string>delivered</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
......
......@@ -30,11 +30,11 @@
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Post</string> </value>
<value> <string>deliver</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/CashSortingIncident_viewPostDialog</string> </value>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=deliver_action</string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
......@@ -52,11 +52,11 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>post_dialog_action</string> </value>
<value> <string>deliver_action</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
<value> <string>delivered</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
......@@ -64,7 +64,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
<value> <string>Deliver</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......@@ -90,7 +90,7 @@
<value>
<tuple>
<string>Manager</string>
<string>Assignor</string>
<string>Assignee</string>
</tuple>
</value>
</item>
......
......@@ -74,6 +74,7 @@ from Products.ERP5Type.Message import Message\n
# Purchase Transaction .\n
transaction = state_change.object\n
\n
\n
# use of the constraint : Test if quantity is multiple of 1000\n
vliste = transaction.checkConsistency()\n
transaction.log(\'vliste\', vliste)\n
......
......@@ -64,7 +64,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Terminate Operation</string> </value>
<value> <string>Validate</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
......@@ -82,6 +82,7 @@ price = transaction.getSourceTotalAssetPrice()\n
input_cash = transaction.getTotalPrice(portal_type=[\'Incoming Classification Survey Line\',\'Cash Delivery Cell\'],fast=0)\n
output_cash = transaction.getTotalPrice(portal_type=[\'Outgoing Classification Survey Line\',\'Cash Delivery Cell\'],fast=0)\n
\n
\n
if input_cash != output_cash :\n
msg=Message(domain="ui", message="Incoming cash amount is different from outgoing cash amount.")\n
raise ValidationFailed, (msg,)\n
......
......@@ -78,6 +78,11 @@ transaction = state_change.object\n
vault = transaction.getSource()\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Cash Delivery Line\')\n
\n
# check again that we are in the good accounting date\n
if not transaction.Baobab_checkCounterDateOpen(site=vault, date=transaction.getStartDate()):\n
msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
raise ValidationFailed, (msg,)\n
\n
# Get price and total_price.\n
amount = transaction.getSourceTotalAssetPrice()\n
total_price = transaction.getTotalPrice(portal_type=[\'Cash Delivery Line\',\'Cash Delivery Cell\'],fast=0)\n
......@@ -144,9 +149,9 @@ elif resource <> 0 :\n
<string>transaction</string>
<string>vault</string>
<string>resource</string>
<string>msg</string>
<string>amount</string>
<string>total_price</string>
<string>msg</string>
</tuple>
</value>
</item>
......
......@@ -73,6 +73,7 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
object = state_change.object\n
\n
\n
# use of the constraint\n
vliste = object.checkConsistency()\n
object.log(\'vliste\', vliste)\n
......
......@@ -92,12 +92,13 @@ if \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\
\n
# check between letter and destination site codification\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
if \'transit\' not in dest.getRelativeUrl():\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>
</item>
<item>
......
......@@ -72,6 +72,7 @@
from Products.ERP5Type.Message import Message\n
\n
ob = state_change[\'object\']\n
\n
# check presence of banknote\n
if len(ob.objectValues()) == 0:\n
msg = Message(domain = "ui", message="No mutilated banknotes defined.")\n
......
......@@ -42,6 +42,8 @@
<tuple>
<string>deliver</string>
<string>deliver_action</string>
<string>reject</string>
<string>reject_action</string>
</tuple>
</value>
</item>
......
......@@ -84,6 +84,8 @@
<value>
<tuple>
<string>Assignee</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......
......@@ -84,6 +84,8 @@
<value>
<tuple>
<string>Assignee</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......
......@@ -84,6 +84,7 @@
<value>
<tuple>
<string>Assignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......
......@@ -84,6 +84,7 @@
<value>
<tuple>
<string>Assignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......
164
\ No newline at end of file
167
\ No newline at end of file
......@@ -8,7 +8,7 @@ Account Incident | incoming_view
Account Incident | metadata
Account Incident | outgoing_input
Account Incident | outgoing_view
Account Incident | print_pdf
Account Incident | print
Account Incident | view
Cash Balance Regulation Module | list
Cash Balance Regulation Module | list_ui
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Folder_print</string> </value>
<value> <string>string:${object_url}/Base_printPdf</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Folder_print</string> </value>
<value> <string>string:${object_url}/Base_printPdf</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Folder_print</string> </value>
<value> <string>string:${object_url}/Base_printPdf</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -70,7 +70,7 @@
<key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n
\n
return DateTime(\'2006-12-31\')\n
return DateTime(\'2007-12-31\')\n
</string> </value>
</item>
<item>
......
......@@ -104,6 +104,7 @@
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>DestinationAssignee</string>
<string>Manager</string>
</tuple>
</value>
......
64
\ No newline at end of file
66
\ 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