Commit e6e9ca56 authored by Jérome Perrin's avatar Jérome Perrin

FEC: prevent parralel computation of the report

parent e65b757e
No related merge requests found
......@@ -59,12 +59,23 @@ if person_value is None:\n
return context.Base_redirect(\'view\', keep_items=dict(\n
portal_status_message=translateString("No person found for your user")))\n
\n
tag = \'AccountingTransactionModule_viewFrenchAccountingTransactionFile\'\n
aggregate_tag = \'%s:aggregate\'\n
\n
if portal.portal_activities.countMessageWithTag(tag) or \\\n
portal.portal_activities.countMessageWithTag(aggregate_tag):\n
return context.Base_redirect(form_id, keep_items=dict(\n
portal_status_message=translateString("Report already in progress.")))\n
\n
\n
context.activate().AccountingTransactionModule_viewFrenchAccountingTransactionFileActive(\n
section_category,\n
section_category_strict,\n
at_date,\n
simulation_state,\n
user_name=person_value.getReference())\n
user_name=person_value.getReference(),\n
tag=tag,\n
after_tag=aggregate_tag)\n
\n
return context.Base_redirect(form_id, keep_items=dict(\n
portal_status_message=translateString("Report Started")))\n
......
......@@ -63,8 +63,6 @@ from_date = portal.Base_getAccountingPeriodStartDateForSectionCategory(\n
# XXX we need proxy role for that\n
active_process = portal.portal_activities.newActiveProcess()\n
\n
tag = "%s-%s" % (script.getId(), random.randint(0, 1000))\n
aggregate_tag = "%s:aggregate" % tag\n
priority = 4\n
\n
for portal_type in portal.getPortalAccountingTransactionTypeList():\n
......@@ -90,7 +88,7 @@ context.activate(after_tag=(tag, aggregate_tag)).AccountingTransactionModule_agg
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>section_category, section_category_strict, at_date, simulation_state, user_name, **kw</string> </value>
<value> <string>section_category, section_category_strict, at_date, simulation_state, user_name, tag, aggregate_tag, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......
30
\ No newline at end of file
31
\ 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