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 ...@@ -75,9 +75,9 @@ currency = transaction.getResourceTitle()\n
encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/sortante"\n encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/sortante"\n
\n \n
\n \n
var_ressource_title = transaction.getResourceTitle().lower()\n ressource_title = transaction.getResourceTitle().lower()\n
var_ressource_title = var_ressource_title.replace(" ", "_")\n ressource_title = ressource_title.replace(" ", "_")\n
encaisse_devise = "/encaisse_des_devises/%s/entrante" %(var_ressource_title)\n encaisse_devise = "/encaisse_des_devises/%s/entrante" %(ressource_title)\n
\n \n
#encaisse_devise = "/encaisse_des_devises/%s/entrante" %(transaction.getResourceTitle().lower())\n #encaisse_devise = "/encaisse_des_devises/%s/entrante" %(transaction.getResourceTitle().lower())\n
\n \n
...@@ -106,8 +106,12 @@ if base_price is None or base_price <= 0:\n ...@@ -106,8 +106,12 @@ if base_price is None or base_price <= 0:\n
fix_montant = transaction.getDiscount()\n fix_montant = transaction.getDiscount()\n
pourcentage = transaction.getDiscountRatio()\n pourcentage = transaction.getDiscountRatio()\n
\n \n
\n # check resource on incoming line\n
\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 \n
resource_two = transaction.CashDelivery_checkCounterInventory(outgoing_source,portal_type=\'Outgoing Cash To Currency Purchase Line\')\n resource_two = transaction.CashDelivery_checkCounterInventory(outgoing_source,portal_type=\'Outgoing Cash To Currency Purchase Line\')\n
\n \n
...@@ -190,7 +194,7 @@ elif resource_two!= 0 :\n ...@@ -190,7 +194,7 @@ elif resource_two!= 0 :\n
<string>_getattr_</string> <string>_getattr_</string>
<string>currency</string> <string>currency</string>
<string>encaisse_billets_et_monnaies</string> <string>encaisse_billets_et_monnaies</string>
<string>var_ressource_title</string> <string>ressource_title</string>
<string>encaisse_devise</string> <string>encaisse_devise</string>
<string>counter_site</string> <string>counter_site</string>
<string>incoming_destination</string> <string>incoming_destination</string>
...@@ -201,6 +205,9 @@ elif resource_two!= 0 :\n ...@@ -201,6 +205,9 @@ elif resource_two!= 0 :\n
<string>msg</string> <string>msg</string>
<string>fix_montant</string> <string>fix_montant</string>
<string>pourcentage</string> <string>pourcentage</string>
<string>doc_resource</string>
<string>_getiter_</string>
<string>line</string>
<string>resource_two</string> <string>resource_two</string>
<string>billetage_entre</string> <string>billetage_entre</string>
<string>billetage_sorti</string> <string>billetage_sorti</string>
......
...@@ -83,7 +83,7 @@ if len(object.objectValues(portal_type=\'Cash Delivery Line\')) == 0:\n ...@@ -83,7 +83,7 @@ if len(object.objectValues(portal_type=\'Cash Delivery Line\')) == 0:\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
dest = object.getDestinationValue()\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 msg = Message(domain="ui", message="Wrong Destination Selected.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
...@@ -154,6 +154,7 @@ if \'transit\' not in dest.getRelativeUrl():\n ...@@ -154,6 +154,7 @@ if \'transit\' not in dest.getRelativeUrl():\n
<string>len</string> <string>len</string>
<string>msg</string> <string>msg</string>
<string>dest</string> <string>dest</string>
<string>None</string>
<string>first_movement</string> <string>first_movement</string>
<string>line_letter</string> <string>line_letter</string>
</tuple> </tuple>
......
521 522
\ 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