diff options
| author | Harry (Open ERP) <hmo@tinyerp.com> | 2009-12-17 18:52:31 +0530 |
|---|---|---|
| committer | Harry (Open ERP) <hmo@tinyerp.com> | 2009-12-17 18:52:31 +0530 |
| commit | 6d32891c048f51d1c678e9f343dfdf3210fdd2b6 (patch) | |
| tree | 465519fa32fef6948b1f641bfc0bcb34217adb2e /addons/document/directory_content.py | |
| parent | 1b8c310a0a009b9c031e6bb177673bdf65a84b90 (diff) | |
[FIX] document, document_ics, document_ftp : solved problem to read content data
bzr revid: hmo@tinyerp.com-20091217132231-a4zcin2lvd2qjjsn
Diffstat (limited to 'addons/document/directory_content.py')
| -rw-r--r-- | addons/document/directory_content.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/addons/document/directory_content.py b/addons/document/directory_content.py index b82da1bce8a..0b1b444e83a 100644 --- a/addons/document/directory_content.py +++ b/addons/document/directory_content.py @@ -98,18 +98,16 @@ class document_directory_content(osv.osv): res2.append(n) return res2 - def process_write(self, cr, uid, node, data): + def process_write(self, cr, uid, node, data, context=None): if node.extension != '.pdf': raise Exception("Invalid content: %s" % node.extension) return True - def process_read(self, cr, uid, node): + def process_read(self, cr, uid, node, context=None): if node.extension != '.pdf': raise Exception("Invalid content: %s" % node.extension) report = self.pool.get('ir.actions.report.xml').browse(cr, uid, node.report_id) srv = netsvc.Service._services['report.'+report.report_name] - pdf,pdftype = srv.create(cr, uid, [node.context.context['res_id']], {}, {}) - s = StringIO.StringIO(pdf) - s.name = node - return s + pdf,pdftype = srv.create(cr, uid, [node.context.context['res_id']], {}, {}) + return pdf document_directory_content() |
