[FIX] setup Environment for the report thread

This commit is contained in:
André Paramés 2014-07-14 12:41:07 +01:00
parent 4acee39f80
commit 8083afe7c3
1 changed files with 20 additions and 19 deletions

View File

@ -87,6 +87,7 @@ def exp_report(db, uid, object, ids, datas=None, context=None):
self_reports[id] = {'uid': uid, 'result': False, 'state': False, 'exception': None}
def go(id, uid, ids, datas, context):
with openerp.api.Environment.manage():
cr = openerp.registry(db).cursor()
try:
result, format = openerp.report.render_report(cr, uid, ids, object, datas, context)