Add missing converter to get_style_content of ir.action.report

review203001
This commit is contained in:
Cédric Krier committed 2011-12-09 12:19:47 +01:00
1 parent 7c54cb0d6c
commit d6e9bb5103
1 file changed
+7 -1
+7 -1
View File
@@ -425,6 +425,12 @@ class ActionReport(ModelSQL, ModelView):
def get_style_content(self, ids, name):
res = {}
converter = buffer
default = False
format_ = Transaction().context.pop('%s.%s' % (self._name, name), '')
if format_ == 'size':
converter = len
default = 0
for report in self.browse(ids):
try:
with file_open( report.style.replace('/', os.sep),
@@ -432,7 +438,7 @@ class ActionReport(ModelSQL, ModelView):
data = fp.read()
except Exception:
data = False
res[report.id] = data
res[report.id] = converter(data) if data else default
return res
def get_pyson(self, ids, name):