[FIX]hr_holidays, hr_timesheet: XMLSyntaxError Error occurred when company name have ampersand '&' sign (Case: Ref 591630)

bzr revid: skh@openerp.com-20130422124943-04zhbhbj9snvikqv
This commit is contained in:
Somesh Khare (OpenERP) 2013-04-22 18:19:43 +05:30
parent 856083e2b4
commit 4ed53ad39e
2 changed files with 3 additions and 2 deletions

View File

@ -96,7 +96,7 @@ class report_custom(report_rml):
res=cr.fetchone()[0]
date_xml=[]
date_today=time.strftime('%Y-%m-%d %H:%M:%S')
date_xml +=['<res name="%s" today="%s" />' % (res,date_today)]
date_xml +=['<res name="%s" today="%s" />' % (to_xml(res),date_today)]
cr.execute("SELECT id, name, color_name FROM hr_holidays_status ORDER BY id")
legend=cr.fetchall()

View File

@ -27,6 +27,7 @@ from openerp import pooler
from openerp.tools.translate import _
from openerp.report import report_sxw
from openerp.tools import ustr
from openerp.tools import to_xml
def lengthmonth(year, month):
@ -104,7 +105,7 @@ class report_custom(report_rml):
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name))
xml='''<?xml version="1.0" encoding="UTF-8" ?>
<report>