Commit 03cdc0ee authored by Aurel's avatar Aurel

fix way to check resource defined on line

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17019 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 42e91f8a
...@@ -109,7 +109,7 @@ pourcentage = transaction.getDiscountRatio()\n ...@@ -109,7 +109,7 @@ pourcentage = transaction.getDiscountRatio()\n
# check resource on incoming line\n # check resource on incoming line\n
doc_resource = transaction.getResource()\n doc_resource = transaction.getResource()\n
for line in transaction.contentValues(portal_type="Incoming Cash To Currency Purchase Line"):\n for line in transaction.contentValues(portal_type="Incoming Cash To Currency Purchase Line"):\n
if line.getResource() != doc_resource:\n if line.getResourceValue().getPriceCurrency() != doc_resource:\n
msg = Message(domain="ui", message="Resource defined on document is different from input cash.")\n msg = Message(domain="ui", message="Resource defined on document is different from input cash.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
......
...@@ -80,6 +80,13 @@ encaisse_devise = "/encaisse_des_devises/%s/sortante" %(var_ressource_title)\n ...@@ -80,6 +80,13 @@ encaisse_devise = "/encaisse_des_devises/%s/sortante" %(var_ressource_title)\n
encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/entrante"\n encaisse_billets_et_monnaies = "/encaisse_des_billets_et_monnaies/entrante"\n
\n \n
\n \n
# check resource on incoming line\n
doc_resource = transaction.getResource()\n
for line in transaction.contentValues(portal_type="Outgoing Cash To Currency Sale Line"):\n
if line.getResourceValue().getPriceCurrency() != doc_resource:\n
msg = Message(domain="ui", message="Resource defined on document is different from input cash.")\n
raise ValidationFailed, (msg,)\n
\n
counter_site = transaction.getSource()\n counter_site = transaction.getSource()\n
\n \n
# check we don\'t change of user\n # check we don\'t change of user\n
...@@ -187,6 +194,10 @@ elif resource_one != 0 :\n ...@@ -187,6 +194,10 @@ elif resource_one != 0 :\n
<string>var_ressource_title</string> <string>var_ressource_title</string>
<string>encaisse_devise</string> <string>encaisse_devise</string>
<string>encaisse_billets_et_monnaies</string> <string>encaisse_billets_et_monnaies</string>
<string>doc_resource</string>
<string>_getiter_</string>
<string>line</string>
<string>msg</string>
<string>counter_site</string> <string>counter_site</string>
<string>outgoing_source</string> <string>outgoing_source</string>
<string>context</string> <string>context</string>
...@@ -195,7 +206,6 @@ elif resource_one != 0 :\n ...@@ -195,7 +206,6 @@ elif resource_one != 0 :\n
<string>billetage_sorti</string> <string>billetage_sorti</string>
<string>base_price</string> <string>base_price</string>
<string>quantity</string> <string>quantity</string>
<string>msg</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
522 523
\ 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