Commit 96a19421 authored by Aurel's avatar Aurel

when doing a destruction from an auxiliary agency, site than can be selected depends on the vault

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24558 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f80b260a
...@@ -90,11 +90,21 @@ if \'encaisse_des_externes\' in vault:\n ...@@ -90,11 +90,21 @@ if \'encaisse_des_externes\' in vault:\n
msg = Message(domain="ui", message="Invalid Foreign Agency.")\n msg = Message(domain="ui", message="Invalid Foreign Agency.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
if "auxiliaire" in vault and transaction.getSourceSection() in (None, ""):\n if "auxiliaire" in vault:\n
msg = Message(domain="ui", message="You must select a foreign agency.")\n site = transaction.getSourceSection()\n
raise ValidationFailed, (msg,)\n if site in (None, ""):\n
\n msg = Message(domain="ui", message="You must select a foreign agency.")\n
\n raise ValidationFailed, (msg,)\n
source_country = transaction.Baobab_getCountryForSite(transaction.getSource())\n
site_country = transaction.Baobab_getCountryForSite(site)\n
if \'encaisse_des_externes\' in vault and \\\n
site_country == source_country:\n
msg = Message(domain="ui", message="You must select an agency from a foreign country.") \n
raise ValidationFailed, (msg,)\n
elif site_country == source_country: \n
msg = Message(domain="ui", message="You must select an agency from the same country.") \n
raise ValidationFailed, (msg,)\n
\n
# In case of dematerialization, we must have only coins\n # In case of dematerialization, we must have only coins\n
if transaction.isDematerialization():\n if transaction.isDematerialization():\n
for line in transaction.objectValues(portal_type=\'Monetary Destruction Line\'):\n for line in transaction.objectValues(portal_type=\'Monetary Destruction Line\'):\n
...@@ -120,7 +130,7 @@ if transaction.isDematerialization():\n ...@@ -120,7 +130,7 @@ if transaction.isDematerialization():\n
# Get price and total_price.\n # Get price and total_price.\n
amount = transaction.getSourceTotalAssetPrice()\n amount = transaction.getSourceTotalAssetPrice()\n
total_price = transaction.getTotalPrice(portal_type=[\'Monetary Destruction Line\',\'Monetary Destruction Cell\'],fast=0)\n total_price = transaction.getTotalPrice(portal_type=[\'Monetary Destruction Line\',\'Monetary Destruction Cell\'],fast=0)\n
resource = transaction.CashDelivery_checkCounterInventory(source=source_object.getPath(), portal_type=\'Monetary Destruction Line\')\n resource = transaction.CashDelivery_checkCounterInventory(source=source_object.getRelativeUrl(), portal_type=\'Monetary Destruction Line\')\n
\n \n
if resource == 2:\n if resource == 2:\n
msg = Message(domain="ui", message="No Resource.")\n msg = Message(domain="ui", message="No Resource.")\n
...@@ -190,6 +200,9 @@ elif resource <> 0 :\n ...@@ -190,6 +200,9 @@ elif resource <> 0 :\n
<string>msg</string> <string>msg</string>
<string>source_section</string> <string>source_section</string>
<string>None</string> <string>None</string>
<string>site</string>
<string>source_country</string>
<string>site_country</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>line</string> <string>line</string>
<string>amount</string> <string>amount</string>
......
646 647
\ 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