Commit da5277ab authored by Sebastien Robin's avatar Sebastien Robin

fixed the way we call script inside scripts of check_payment workflow

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9605 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7bbbf49c
......@@ -134,7 +134,7 @@ for line in listbox:\n
check_type_relative_url = check_type_relative_url[len(\'check_type/\'):]\n
line_kw_dict[\'check_type\'] = check_type_relative_url\n
check_type = context.getPortalObject().restrictedTraverse(check_type_relative_url)\n
line_kw_dict[\'price\'] = check_type.getQuantity()\n
line_kw_dict[\'price\'] = check_type.getPrice()\n
line_kw_dict[\'price_currency\'] = check_type.getParentValue().getPriceCurrency()\n
if add_line:\n
number_of_line_created += 1\n
......
......@@ -102,7 +102,7 @@
<value>
<list>
<string>my_title</string>
<string>my_quantity</string>
<string>my_price</string>
<string>my_description</string>
</list>
</value>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_quantity</string> </value>
<value> <string>my_price</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -69,6 +69,9 @@
<item>
<key> <string>_body</string> </key>
<value> <string>context.setSource(context.getBaobabSource())\n
reference_currency = context.Baobab_getPortalReferenceCurrencyID()\n
context.setPriceCurrency(\'currency_module/%s\' %(reference_currency,))\n
context.setCurrencyExchangeType(\'transfer\')\n
</string> </value>
</item>
<item>
......@@ -118,6 +121,7 @@
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>reference_currency</string>
</tuple>
</value>
</item>
......
......@@ -345,6 +345,10 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>price</string>
<string>Amount</string>
</tuple>
<tuple>
<string>quantity</string>
<string>Quantity</string>
......
......@@ -85,7 +85,7 @@ if not transaction.Baobab_checkCounterDateOpen(site=source, date=date):\n
\n
site = transaction.getSourceValue()\n
\n
if not context.Baobab_checkCounterOpened(site):\n
if not transaction.Baobab_checkCounterOpened(site):\n
msg = Message(domain = "ui", message="Counter is not opened")\n
raise ValidationFailed, (msg,)\n
\n
......@@ -100,12 +100,12 @@ price = transaction.getSourceTotalAssetPrice()\n
bank_account.serialize()\n
\n
# Make sure there are no other operations pending for this account\n
if context.BankAccount_isMessagePending(bank_account):\n
if transaction.BankAccount_isMessagePending(bank_account):\n
msg = Message(domain=\'ui\', message="There are operations pending for this account that prevent form calculating its position. Please try again later.")\n
raise ValidationFailed, (msg,)\n
\n
# Index the banking operation line so it impacts account position\n
context.BankingOperationLine_index(line)\n
transaxtion.BankingOperationLine_index(line)\n
\n
# Check if the banking operation is correct. Do not depend on catalog because line might not be indexed immediatelly.\n
if - price != (line.getPrice() * line.getQuantity()):\n
......@@ -113,7 +113,7 @@ if - price != (line.getPrice() * line.getQuantity()):\n
raise ValidationFailed, (msg,)\n
\n
# Test if the account balance is sufficient.\n
error = context.BankAccount_checkBalance(bank_account.getRelativeUrl(), price)\n
error = transaction.BankAccount_checkBalance(bank_account.getRelativeUrl(), price)\n
if error[\'error_code\'] == 1:\n
msg = Message(domain=\'ui\', message="Bank account is not sufficient.")\n
raise ValidationFailed, (msg,)\n
......@@ -192,6 +192,7 @@ elif error[\'error_code\'] != 0:\n
<string>line</string>
<string>bank_account</string>
<string>price</string>
<string>transaxtion</string>
<string>error</string>
</tuple>
</value>
......
......@@ -91,6 +91,7 @@
<tuple>
<string>Manager</string>
<string>Assignee</string>
<string>Assignor</string>
</tuple>
</value>
</item>
......
......@@ -91,6 +91,7 @@
<tuple>
<string>Manager</string>
<string>Assignee</string>
<string>Assignor</string>
</tuple>
</value>
</item>
......
......@@ -68,7 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
<value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
delivery = state_change.object\n
portal = context.getPortalObject()\n
......@@ -113,9 +115,10 @@ for line in line_list:\n
item.setReference(reference_range_min)\n
item.setTitle(reference_range_min)\n
reference_range_min = str(int(float(reference_range_min)) + 1)\n
if resource.isQuantityRequired():\n
item.setQuantity(line.getPrice())\n
item.setPriceCurrency(line.getPriceCurrency())\n
if len(resource.objectValues())>0:\n
item_type = line.getCheckTypeValue()\n
item.setPrice(item_type.getPrice())\n
item.setPriceCurrency(line.getPriceCurrency())\n
item.setDestinationPayment(line.getDestinationPayment())\n
item.setDestinationTrade(line.getDestinationTrade())\n
item.setResourceValue(resource)\n
......@@ -126,7 +129,9 @@ for line in line_list:\n
\n
# Finally set the aggregate list on the line\n
line.setAggregateValueList(aggregate_list)\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -205,6 +210,8 @@ for line in line_list:\n
<string>str</string>
<string>int</string>
<string>float</string>
<string>len</string>
<string>item_type</string>
</tuple>
</value>
</item>
......
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