Skip to content
Snippets Groups Projects
Commit 1ea82dc8 authored by Husen Daudi's avatar Husen Daudi
Browse files

bugfix by nch for dms

bzr revid: hda@hda-20090205133255-3fiwfn2290tkqak7
parent 580ab8c7
No related merge requests found
......@@ -656,19 +656,23 @@ class report_sxw(report_rml):
d = base64.decodestring(brow_rec.datas)
results.append((d,'pdf'))
continue
result = self.create_single(cr, uid, [obj.id], data, report_xml, context)
if aname:
name = aname+'.'+result[1]
pool.get('ir.attachment').create(cr, uid, {
'name': aname,
'datas': base64.encodestring(result[0]),
'datas_fname': name,
'res_model': self.table,
'res_id': obj.id,
}, context=context
)
cr.commit()
try:
if aname:
name = aname+'.'+result[1]
pool.get('ir.attachment').create(cr, uid, {
'name': aname,
'datas': base64.encodestring(result[0]),
'datas_fname': name,
'res_model': self.table,
'res_id': obj.id,
}, context=context
)
cr.commit()
except Exception,e:
import traceback, sys
tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
netsvc.Logger().notifyChannel('report', netsvc.LOG_ERROR,str(e))
results.append(result)
if results:
if results[0][1]=='pdf':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment