Commit a72ec045 authored by Aurel's avatar Aurel

* user which did 'deliver action' is now record on object to prevent...

* user which did 'deliver action' is now record on object to prevent indexation pb if his assignment change in future
* check we pass wf transition with the user assigned at the same vault as the original one

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14675 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd8201b8
......@@ -28,14 +28,16 @@
<item>emission_letter</item>
</portal_type>
<portal_type id="Container Line">
<item>emission_letter</item>
<item>variation</item>
<item>emission_letter</item>
<item>cash_status</item>
</portal_type>
<portal_type id="Currency Purchase">
<item>source_trade</item>
<item>currency_exchange_type</item>
</portal_type>
<portal_type id="Currency Sale">
<item>source_trade</item>
<item>currency_exchange_type</item>
</portal_type>
<portal_type id="Foreign Cash Reception">
......@@ -48,6 +50,7 @@
<item>variation</item>
</portal_type>
<portal_type id="Money Deposit">
<item>source_trade</item>
<item>external_software</item>
</portal_type>
<portal_type id="Mutilated Banknote">
......
......@@ -109,6 +109,10 @@
<key> <string>init_script</string> </key>
<value> <string>CurrencyPurchase_init</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>property_sheet_list</string> </key>
<value>
......
......@@ -99,6 +99,10 @@
<key> <string>init_script</string> </key>
<value> <string>CurrencySale_init</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>property_sheet_list</string> </key>
<value>
......
......@@ -65,29 +65,26 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
var_ressource_title = context.getResourceTitle().lower()\n
var_ressource_title = var_ressource_title.replace(" ", "_")\n
encaisse_devise = "/encaisse_des_devises/%s/sortante" %(var_ressource_title)\n
\n
#encaisse_devise = "/encaisse_des_devises/%s/sortante" %(context.getResourceTitle().lower())\n
\n
# first get the source of the document,\n
# we will need to add the counter\n
# Get the history of the workflow\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'currency_purchase_workflow\', transition_id=\'deliver_action\')\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
destination = context.getSource()\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n
if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n
return site + encaisse_devise\n
msg = Message(domain=\'ui\', message=\'Your user is not well assigned\')\n
raise ValidationFailed, (msg,)\n
<value> <string>source_trade = context.getSourceTrade()\n
if source_trade is None:\n
encaisse_devise = "/encaisse_des_devises/%s/sortante" %(context.getResourceTitle(\'\').lower().replace(" ", "_"),)\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'currency_purchase_workflow\', transition_id=\'deliver_action\')\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
destination = context.getSource()\n
for site in site_list:\n
site_value = context.portal_categories.getCategoryValue(site)\n
if site_value.getVaultType().endswith(\'guichet\') and destination in site:\n
source_trade = site + encaisse_devise\n
if context.getSimulationState() == "delivered":\n
context.setSourceTrade(source_trade)\n
return source_trade\n
\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
msg = Message(domain=\'ui\', message=\'Your user is not well assigned\')\n
raise ValidationFailed, (msg,)\n
</string> </value>
</item>
<item>
......@@ -138,21 +135,21 @@ raise ValidationFailed, (msg,)\n
<tuple>
<string>args</string>
<string>kw</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string>
<string>context</string>
<string>var_ressource_title</string>
<string>source_trade</string>
<string>None</string>
<string>encaisse_devise</string>
<string>user_id</string>
<string>None</string>
<string>site_list</string>
<string>destination</string>
<string>_getiter_</string>
<string>site</string>
<string>site_value</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>msg</string>
</tuple>
</value>
......
......@@ -65,32 +65,30 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
<value> <string>source_trade = context.getSourceTrade()\n
if source_trade is None:\n
if (context.getResourceTitle() != None):\n
encaisse_devise = "/encaisse_des_devises/%s/sortante" %(context.getResourceTitle().lower().replace(" ", "_"))\n
else:\n
encaisse_devise = "/encaisse_des_devises/"\n
\n
if (context.getResourceTitle() != None):\n
var_ressource_title = context.getResourceTitle().lower()\n
var_ressource_title = var_ressource_title.replace(" ", "_")\n
encaisse_devise = "/encaisse_des_devises/%s/sortante" %(var_ressource_title)\n
else:\n
encaisse_devise = "/encaisse_des_devises/"\n
\n
#encaisse_devise = "/encaisse_des_devises/%s/sortante" %(context.getResourceTitle().lower())\n
\n
# first get the source of the document,\n
# we will need to add the counter\n
# Get the history of the workflow\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'currency_sale_workflow\', transition_id=\'deliver_action\')\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
source = context.getSource()\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
return site + encaisse_devise\n
msg = Message(domain=\'ui\', message=\'Your user is not well assigned\')\n
raise ValidationFailed, (msg,)\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'currency_sale_workflow\', transition_id=\'deliver_action\')\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
source = context.getSource()\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
source_trade = site + encaisse_devise\n
if context.getSimulationState() == "delivered":\n
context.setSourceTrade(source_trade)\n
return source_trade\n
\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
msg = Message(domain=\'ui\', message=\'Your user is not well assigned\')\n
raise ValidationFailed, (msg,)\n
</string> </value>
</item>
<item>
......@@ -139,14 +137,10 @@ raise ValidationFailed, (msg,)\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string>
<string>context</string>
<string>source_trade</string>
<string>None</string>
<string>var_ressource_title</string>
<string>encaisse_devise</string>
<string>user_id</string>
<string>site_list</string>
......@@ -154,6 +148,10 @@ raise ValidationFailed, (msg,)\n
<string>_getiter_</string>
<string>site</string>
<string>site_value</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>msg</string>
</tuple>
</value>
......
......@@ -66,16 +66,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>currency = context.getResourceTitle()\n
#context.log(\'currency\', currency)\n
var_ressource_title = context.getParentValue().getResourceTitle().lower()\n
var_ressource_title = var_ressource_title.replace(" ", "_")\n
#context.log(\'var_ressource_title\', var_ressource_title)\n
\n
#encaisse_devise = "/encaisse_des_devises/%s/entrante" %(context.getParentValue().getResourceTitle().lower())\n
encaisse_devise = "/encaisse_des_devises/%s/sortante" %(var_ressource_title)\n
\n
#context.log(\'encaisse_devise\', encaisse_devise)\n
\n
encaisse_devise = "/encaisse_des_devises/%s/sortante" %(context.getParentValue().getResourceTitle(\'\').lower().replace(" ", "_"))\n
counter_site = context.getSource()\n
destination = counter_site + encaisse_devise\n
return destination\n
......@@ -155,7 +146,6 @@ return destination\n
<string>_getattr_</string>
<string>context</string>
<string>currency</string>
<string>var_ressource_title</string>
<string>encaisse_devise</string>
<string>counter_site</string>
<string>destination</string>
......
......@@ -65,20 +65,26 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>destination = context.getDestination()\n
if destination is None:\n
return None\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'money_deposit_workflow\', transition_id=\'deliver_action\')\n
context.log(\'user_id\',user_id)\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
for site in site_list:\n
if context.portal_categories.getCategoryValue(site).getVaultType().endswith(\'guichet\') and destination in site:\n
return site + \'/encaisse_des_billets_et_monnaies/entrante\'\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
<value> <string>source_trade = context.getSourceTrade()\n
if source_trade is None:\n
destination = context.getDestination()\n
if destination is None:\n
return None\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'money_deposit_workflow\', transition_id=\'deliver_action\')\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
for site in site_list:\n
if context.portal_categories.getCategoryValue(site).getVaultType().endswith(\'guichet\') and destination in site:\n
source_trade = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
if context.getSimulationState() == \'delivered\':\n
context.setSourceTrade(source_trade)\n
return source_trade\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
else:\n
return source_trade\n
</string> </value>
</item>
<item>
......@@ -131,8 +137,9 @@ raise ValueError,message\n
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>destination</string>
<string>source_trade</string>
<string>None</string>
<string>destination</string>
<string>user_id</string>
<string>site_list</string>
<string>_getiter_</string>
......
......@@ -73,6 +73,7 @@ if source.split("/")[-1] == destination.split("/")[-1]:\n
variation = context.getVariationText()\n
result = variation.replace(\'new_emitted\', \'valid\')\n
return result\n
return context.getVariationText()\n
</string> </value>
</item>
<item>
......
......@@ -96,28 +96,27 @@ if not transaction.Baobab_checkCounterDateOpen(site=source_object, date=date):\n
raise ValidationFailed, (msg,)\n
\n
\n
in_list = transaction.objectValues(portal_type=\'Incoming Account Incident Line\')\n
out_list = transaction.objectValues(portal_type=\'Outgoing Account Incident Line\')\n
vault = "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(transaction.getSource(),)\n
price = transaction.getSourceTotalAssetPrice()\n
in_price = transaction.getTotalPrice(portal_type=[\'Incoming Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
out_price = transaction.getTotalPrice(portal_type=[\'Outgoing Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
\n
if len(in_list) != 0 and len(out_list) != 0:\n
if in_price == 0 and out_price == 0: # Both prices cannot be equal to 0 at the same time\n
msg = Message(domain = "ui", message="No resource.")\n
raise ValidationFailed, (msg,)\n
elif 0 not in (in_price, out_price): # Both prices cannot be different from 0 at the same time\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
elif price not in (in_price, out_price):\n
msg = Message(domain = "ui", message="Price differs between document and resource.")\n
raise ValidationFailed, (msg,)\n
elif len(out_list) !=0:\n
\n
if out_price != 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
if resource <> 0 :\n
msg = Message(domain="ui", message="Insufficient Balance.")\n
raise ValidationFailed, (msg,)\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
\n
# Now we will validate the accounting position\n
transaction = state_change[\'object\']\n
......@@ -229,18 +228,18 @@ if debit:\n
<string>site_value</string>
<string>source_object</string>
<string>msg</string>
<string>in_list</string>
<string>out_list</string>
<string>vault</string>
<string>price</string>
<string>in_price</string>
<string>out_price</string>
<string>len</string>
<string>resource</string>
<string>bank_account</string>
<string>exchange_rate_list</string>
<string>len</string>
<string>ValidationError</string>
<string>line</string>
<string>in_list</string>
<string>out_list</string>
<string>debit</string>
<string>error</string>
</tuple>
......
......@@ -67,7 +67,7 @@
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
transaction = state_change.object\n
transaction = state_change[\'object\']\n
\n
currency = transaction.getResourceTitle()\n
encaisse_billets_et_monnaies_sortante = "/encaisse_des_billets_et_monnaies/sortante"\n
......@@ -78,6 +78,8 @@ counter_site = transaction.getSource()\n
caisse_incoming = counter_site + encaisse_billets_et_monnaies_entrante\n
caisse_outgoing = counter_site + encaisse_billets_et_monnaies_sortante\n
\n
# check we don\'t change of user\n
transaction.Baobab_checkSameUserVault(counter_site)\n
\n
# check again that we are in the good accounting date\n
if not transaction.Baobab_checkCounterDateOpen(site=caisse_outgoing, date=transaction.getStartDate()):\n
......@@ -85,10 +87,10 @@ if not transaction.Baobab_checkCounterDateOpen(site=caisse_outgoing, date=transa
raise ValidationFailed, (msg,)\n
\n
# use of the constraint : Test cash status line\n
vliste = transaction.checkConsistency()\n
transaction.log(\'vliste\', vliste)\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getMessage(),)\n
#vliste = transaction.checkConsistency()\n
#transaction.log(\'vliste\', vliste)\n
#if len(vliste) != 0:\n
# raise ValidationFailed, (vliste[0].getMessage(),)\n
\n
\n
resource_two = transaction.CashDelivery_checkCounterInventory(caisse_outgoing, portal_type=\'Outgoing Cash Exchange Line\')\n
......@@ -169,8 +171,9 @@ if amount_total != outgoing_total:\n
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>transaction</string>
<string>_getattr_</string>
<string>currency</string>
<string>encaisse_billets_et_monnaies_sortante</string>
<string>encaisse_billets_et_monnaies_entrante</string>
......@@ -178,9 +181,6 @@ if amount_total != outgoing_total:\n
<string>caisse_incoming</string>
<string>caisse_outgoing</string>
<string>msg</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>resource_two</string>
<string>incoming_total</string>
<string>outgoing_total</string>
......
......@@ -69,7 +69,7 @@
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
transaction = state_change.object\n
transaction = state_change[\'object\']\n
\n
currency = transaction.getResourceTitle()\n
encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/sortante"\n
......@@ -82,6 +82,10 @@ encaisse_devise = "/encaisse_des_devises/%s/entrante" %(var_ressource_title)\n
#encaisse_devise = "/encaisse_des_devises/%s/entrante" %(transaction.getResourceTitle().lower())\n
\n
counter_site = transaction.getSource()\n
\n
# check we don\'t change of user\n
transaction.Baobab_checkSameUserVault(counter_site)\n
\n
incoming_destination = counter_site + encaisse_devise\n
outgoing_source = counter_site + encaisse_billets_et_monnaies\n
\n
......@@ -180,8 +184,9 @@ elif resource_two!= 0 :\n
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>transaction</string>
<string>_getattr_</string>
<string>currency</string>
<string>encaisse_billets_et_monnaies</string>
<string>var_ressource_title</string>
......
......@@ -67,7 +67,7 @@
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
transaction = state_change.object\n
transaction = state_change[\'object\']\n
\n
currency = transaction.getResourceTitle()\n
\n
......@@ -82,6 +82,8 @@ encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/entrante"\n
\n
counter_site = transaction.getSource()\n
\n
# check we don\'t change of user\n
transaction.Baobab_checkSameUserVault(counter_site)\n
\n
outgoing_source = counter_site + encaisse_devise\n
\n
......@@ -91,10 +93,10 @@ if not transaction.Baobab_checkCounterDateOpen(site=outgoing_source, date=transa
raise ValidationFailed, (msg,)\n
\n
# use of the constraint : Test cash status line\n
vliste = transaction.checkConsistency()\n
transaction.log(\'vliste\', vliste)\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getMessage(),)\n
#vliste = transaction.checkConsistency()\n
#transaction.log(\'vliste\', vliste)\n
#if len(vliste) != 0:\n
# raise ValidationFailed, (vliste[0].getMessage(),)\n
\n
\n
\n
......@@ -176,8 +178,9 @@ elif resource_one != 0 :\n
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>transaction</string>
<string>_getattr_</string>
<string>currency</string>
<string>var_ressource_title</string>
<string>encaisse_devise</string>
......@@ -185,9 +188,6 @@ elif resource_one != 0 :\n
<string>counter_site</string>
<string>outgoing_source</string>
<string>msg</string>
<string>vliste</string>
<string>len</string>
<string>_getitem_</string>
<string>resource_one</string>
<string>billetage_entre</string>
<string>billetage_sorti</string>
......
......@@ -75,6 +75,9 @@ transaction = state_change.object\n
vault = transaction.getSource()\n
date = transaction.getStartDate()\n
\n
# check we don\'t change of user\n
transaction.Baobab_checkSameUserVault(vault)\n
\n
# check we are in an opened accounting day\n
if not transaction.Baobab_checkCounterDateOpen(site=vault, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n
......
......@@ -78,7 +78,9 @@ if transaction.getResource() is None:\n
#transaction.Base_checkBaobabSourceAndDestination()\n
\n
date = transaction.getStartDate()\n
destination= transaction.getDestination(None)\n
destination= transaction.getDestination()\n
# check we don\'t change of user\n
transaction.Baobab_checkSameUserVault(destination)\n
\n
lettering = transaction.getGroupingReference()\n
\n
......
......@@ -76,10 +76,10 @@ resource = transaction.CashDelivery_checkCounterInventory(source = destination,
#transaction.log("call to CashDelivery_getCounterInventory return", resource)\n
\n
# use of the constraint : Test cash status line\n
vliste = transaction.checkConsistency()\n
transaction.log(\'vliste\', vliste)\n
if len(vliste) != 0:\n
raise ValidationFailed, (vliste[0].getMessage(),)\n
#vliste = transaction.checkConsistency()\n
#transaction.log(\'vliste\', vliste)\n
#if len(vliste) != 0:\n
# raise ValidationFailed, (vliste[0].getMessage(),)\n
\n
user_id = transaction.portal_membership.getAuthenticatedMember().getUserName()\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
......@@ -171,8 +171,6 @@ elif price != cash_detail:\n
<string>_getattr_</string>
<string>destination</string>
<string>resource</string>
<string>vliste</string>
<string>len</string>
<string>user_id</string>
<string>context</string>
<string>site_list</string>
......
333
\ No newline at end of file
335
\ No newline at end of file
......@@ -14,11 +14,14 @@ Container Line | cash_status
Container Line | emission_letter
Container Line | variation
Currency Purchase | currency_exchange_type
Currency Purchase | source_trade
Currency Sale | currency_exchange_type
Currency Sale | source_trade
Foreign Cash Reception | currency_exchange_type
Internal Money Deposit | external_software
Monetary Recall Cell | variation
Money Deposit | external_software
Money Deposit | source_trade
Mutilated Banknote | source_decision
Mutilated Banknote | source_trade
Outgoing Cash Sorting Cell | variation
......
......@@ -3,6 +3,7 @@
<item>site</item>
</portal_type>
<portal_type id="Check Payment">
<item>source_trade</item>
<item>aggregate_resource</item>
</portal_type>
<portal_type id="Checkbook Delivery">
......@@ -14,12 +15,12 @@
<item>currency_exchange_type</item>
</portal_type>
<portal_type id="Checkbook Reception Line">
<item>check_amount</item>
<item>check_type</item>
<item>check_amount</item>
</portal_type>
<portal_type id="Stop Payment">
<item>aggregate_resource</item>
<item>currency_exchange_type</item>
<item>aggregate_resource</item>
</portal_type>
<portal_type id="Traveler Check Purchase">
<item>currency_exchange_type</item>
......
......@@ -65,16 +65,21 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>user_id = context.Base_getLastUserIdByTransition(workflow_id=\'check_payment_workflow\', transition_id=\'deliver_action\')\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
source = context.getSource()\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
return site + \'/encaisse_des_billets_et_monnaies/sortante\'\n
return None\n
<value> <string>source_trade = context.getSourceTrade()\n
if source_trade is None:\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'check_payment_workflow\', transition_id=\'deliver_action\')\n
if user_id is not None:\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
source = context.getSource()\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
source_trade = site + \'/encaisse_des_billets_et_monnaies/sortante\'\n
# Save it only once we are sure that the document will not change any more\n
# and that we will not have many users trying to do deliver_action\n
if context.getSimulationState() == \'delivered\':\n
context.setSourceTrade(source_trade)\n
return source_trade\n
</string> </value>
</item>
<item>
......@@ -126,8 +131,9 @@ return None\n
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>user_id</string>
<string>source_trade</string>
<string>None</string>
<string>user_id</string>
<string>site_list</string>
<string>source</string>
<string>_getiter_</string>
......
......@@ -78,6 +78,9 @@ if source is None:\n
msg = Message(domain=\'ui\', message=\'No counter defined.\')\n
raise ValidationFailed, (msg,)\n
\n
# check we don\'t change of user\n
transaction.Baobab_checkSameUserVault(source)\n
\n
# check we are in an opened accounting day\n
if not transaction.Baobab_checkCounterDateOpen(site=source, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n
......@@ -199,6 +202,7 @@ if total_credit>0:\n
<string>item</string>
<string>category_list</string>
<string>base_price</string>
<string>_inplacevar_</string>
<string>round</string>
</tuple>
</value>
......
268
\ No newline at end of file
270
\ No newline at end of file
Check Deposit | site
Check Payment | aggregate_resource
Check Payment | source_trade
Checkbook Delivery Line | check_amount
Checkbook Delivery Line | check_type
Checkbook Delivery Line | currency_exchange_type
......
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