Commit 56871d27 authored by Aurel's avatar Aurel

modify workflow to use new script to check counter date and couter

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8541 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 71ba30c6
......@@ -81,7 +81,7 @@ if len(result) == 0:\n
\n
# Get a checkbook for this bank account.\n
checkbook = None\n
generic_model = context.portal_catalog(portal_type = \'Checkbook Model\', title = \'Generic\')[0].getObject()\n
generic_model = context.portal_catalog(portal_type = \'Checkbook Model\', id = \'generic_checkbook\')[0].getObject()\n
# XXX it would be better to use a related key for this, but z_related_resource is too specific to\n
# movement at the moment.\n
for brain in context.portal_catalog(portal_type = \'Checkbook\',\n
......@@ -121,6 +121,12 @@ transaction.edit(aggregate = check.getRelativeUrl())\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/baobab/portal_workflow/check_payment_workflow/scripts/updateBankingOperation</string> </value>
......@@ -211,4 +217,25 @@ transaction.edit(aggregate = check.getRelativeUrl())\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -79,23 +79,13 @@ if source is None:\n
raise ValidationFailed, (msg,)\n
\n
# check we are in an opened accounting day\n
if not transaction.Baobab_checkCounterDateOpen(site=source, date=transaction.getStartDate()):\n
if not transaction.Baobab_checkCounterDateOpen(site=source, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n
raise ValidationFailed, (msg,)\n
\n
site = transaction.getSourceValue()\n
while True:\n
if not hasattr(site, \'getVaultTypeList\'):\n
msg = Message(domain = \'ui\', message = \'The site value is misconfigured; report this to system administrators.\')\n
raise ValidationFailed, (msg,)\n
if \'site\' in site.getVaultTypeList():\n
break\n
site = site.getParentValue()\n
\n
# check that the counter is opened\n
counter_list = [x.getObject() for x in transaction.portal_catalog(portal_type="Counter", simulation_state = \'open\', site_uid = site.getUid())]\n
\n
if len(counter_list) == 0:\n
if not context.Baobab_checkCounterOpened(site):\n
msg = Message(domain = "ui", message="Counter is not opened")\n
raise ValidationFailed, (msg,)\n
\n
......@@ -192,14 +182,6 @@ elif error[\'error_code\'] != 0:\n
<string>source</string>
<string>msg</string>
<string>site</string>
<string>True</string>
<string>hasattr</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>counter_list</string>
<string>len</string>
<string>context</string>
<string>line</string>
<string>bank_account</string>
......
......@@ -116,6 +116,7 @@ for line in line_list:\n
item.setQuantity(line.getPrice())\n
item.setPriceCurrency(line.getPriceCurrency())\n
item.setDestinationPayment(line.getDestinationPayment())\n
item.setDestinationTrade(line.getDestinationTrade())\n
item.setResourceValue(resource)\n
aggregate_list.append(item)\n
\n
......
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