Commit 69f3652f authored by Aurel's avatar Aurel

check resource is the same between document and lines

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17017 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c71e6e83
......@@ -75,9 +75,9 @@ currency = transaction.getResourceTitle()\n
encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/sortante"\n
\n
\n
var_ressource_title = transaction.getResourceTitle().lower()\n
var_ressource_title = var_ressource_title.replace(" ", "_")\n
encaisse_devise = "/encaisse_des_devises/%s/entrante" %(var_ressource_title)\n
ressource_title = transaction.getResourceTitle().lower()\n
ressource_title = ressource_title.replace(" ", "_")\n
encaisse_devise = "/encaisse_des_devises/%s/entrante" %(ressource_title)\n
\n
#encaisse_devise = "/encaisse_des_devises/%s/entrante" %(transaction.getResourceTitle().lower())\n
\n
......@@ -106,8 +106,12 @@ if base_price is None or base_price <= 0:\n
fix_montant = transaction.getDiscount()\n
pourcentage = transaction.getDiscountRatio()\n
\n
\n
\n
# check resource on incoming line\n
doc_resource = transaction.getResource()\n
for line in transaction.contentValues(portal_type="Incoming Cash To Currency Purchase Line"):\n
if line.getResource() != doc_resource:\n
msg = Message(domain="ui", message="Resource defined on document is different from input cash.")\n
raise ValidationFailed, (msg,)\n
\n
resource_two = transaction.CashDelivery_checkCounterInventory(outgoing_source,portal_type=\'Outgoing Cash To Currency Purchase Line\')\n
\n
......@@ -190,7 +194,7 @@ elif resource_two!= 0 :\n
<string>_getattr_</string>
<string>currency</string>
<string>encaisse_billets_et_monnaies</string>
<string>var_ressource_title</string>
<string>ressource_title</string>
<string>encaisse_devise</string>
<string>counter_site</string>
<string>incoming_destination</string>
......@@ -201,6 +205,9 @@ elif resource_two!= 0 :\n
<string>msg</string>
<string>fix_montant</string>
<string>pourcentage</string>
<string>doc_resource</string>
<string>_getiter_</string>
<string>line</string>
<string>resource_two</string>
<string>billetage_entre</string>
<string>billetage_sorti</string>
......
......@@ -83,7 +83,7 @@ if len(object.objectValues(portal_type=\'Cash Delivery Line\')) == 0:\n
raise ValidationFailed, (msg,)\n
\n
dest = object.getDestinationValue()\n
if \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\n
if dest is None or \'encaisse_des_billets_retires_de_la_circulation\' in dest.getRelativeUrl():\n
msg = Message(domain="ui", message="Wrong Destination Selected.")\n
raise ValidationFailed, (msg,)\n
\n
......@@ -154,6 +154,7 @@ if \'transit\' not in dest.getRelativeUrl():\n
<string>len</string>
<string>msg</string>
<string>dest</string>
<string>None</string>
<string>first_movement</string>
<string>line_letter</string>
</tuple>
......
521
\ No newline at end of file
522
\ 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