[FIX] problem with the print screen
lp bug: https://launchpad.net/bugs/308910 fixed bzr revid: stephane@tinyerp.com-20081217123840-zfo40a5xjn8un3ku
This commit is contained in:
parent
71b1e392f4
commit
488af9a09a
|
@ -132,7 +132,7 @@ class report_printscreen_list(report_int):
|
|||
|
||||
for f in fields_order:
|
||||
field = new_doc.createElement("field")
|
||||
field_txt = new_doc.createTextNode(str(fields[f]['string'] or ''))
|
||||
field_txt = new_doc.createTextNode(fields[f]['string'] or '')
|
||||
field.appendChild(field_txt)
|
||||
header.appendChild(field)
|
||||
|
||||
|
@ -166,7 +166,7 @@ class report_printscreen_list(report_int):
|
|||
col.setAttribute('para','yes')
|
||||
col.setAttribute('tree','no')
|
||||
if line[f] != None:
|
||||
txt = new_doc.createTextNode(str(line[f] or ''))
|
||||
txt = new_doc.createTextNode(line[f] or '')
|
||||
if temp[count] == 1:
|
||||
tsum[count] = float(tsum[count]) + float(line[f]);
|
||||
|
||||
|
@ -203,7 +203,7 @@ class report_printscreen_list(report_int):
|
|||
|
||||
styledoc = libxml2.parseFile(os.path.join(tools.config['root_path'],'addons/base/report/custom_new.xsl'))
|
||||
style = libxslt.parseStylesheetDoc(styledoc)
|
||||
doc = libxml2.parseDoc(new_doc.toxml())
|
||||
doc = libxml2.parseDoc(new_doc.toxml(encoding='utf-8'))
|
||||
rml_obj = style.applyStylesheet(doc, None)
|
||||
rml = style.saveResultToString(rml_obj)
|
||||
self.obj = render.rml(rml, title=self.title)
|
||||
|
|
|
@ -20,30 +20,28 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import base64
|
||||
import xml.dom.minidom
|
||||
import os, time
|
||||
import ir, netsvc
|
||||
import osv
|
||||
from interface import report_rml
|
||||
import re
|
||||
import tools
|
||||
import pooler
|
||||
import netsvc
|
||||
import warnings
|
||||
import locale
|
||||
import copy
|
||||
import StringIO
|
||||
import zipfile
|
||||
import os
|
||||
import base64
|
||||
import copy
|
||||
import ir
|
||||
import locale
|
||||
import mx.DateTime
|
||||
import netsvc
|
||||
import os
|
||||
import osv
|
||||
import pooler
|
||||
import re
|
||||
import time
|
||||
import tools
|
||||
import warnings
|
||||
import xml.dom.minidom
|
||||
import zipfile
|
||||
|
||||
DT_FORMAT = '%Y-%m-%d'
|
||||
DHM_FORMAT = '%Y-%m-%d %H:%M:%S'
|
||||
HM_FORMAT = '%H:%M:%S'
|
||||
|
||||
import base64
|
||||
|
||||
if not hasattr(locale, 'nl_langinfo'):
|
||||
locale.nl_langinfo = lambda *a: '%x'
|
||||
|
||||
|
@ -469,12 +467,11 @@ class rml_parse(object):
|
|||
if isinstance(newtext, list):
|
||||
todo.append((key, newtext))
|
||||
else:
|
||||
#if not isinstance(newtext, basestring):
|
||||
newtext = str(newtext)
|
||||
# if there are two [[]] blocks the same, it will replace both
|
||||
# but it's ok because it should evaluate to the same thing
|
||||
# anyway
|
||||
text = text.replace('[['+key+']]', newtext.decode('utf8'))
|
||||
newtext = tools.ustr(newtext)
|
||||
text = text.replace('[['+key+']]', newtext)
|
||||
self._node.data = text
|
||||
if len(todo):
|
||||
for key, newtext in todo:
|
||||
|
|
Loading…
Reference in New Issue