Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-opw-576075-port-mma into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576075-port-mma/+merge/132476

Hello

Faced the trace-back while opening the HR related reports:
"Employee's Holidays",
"Attendance By Month",
"Employee Time-sheet"
"Employees Time-sheet"

Steps to reproduce the issue:

- Give company name with '&'
- Go to Human Resources/Human Resources/Employees
- Select any Employee
- Try to print the report "Employee's Holidays" and "Attendance By Month"
- Also GO to Human Resources/Reporting/Time-sheet/Employee Time-sheet
- Go to Human Resources/Reporting/Time-sheet/Employees Time-sheet
- ERROR

  This fixes the above issues
  Code is forward port from 6.1

Thanks,
Mayur

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576075-port-mma/+merge/132476
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-opw-576075-port-mma.
=== modified file 'hr_attendance/report/attendance_by_month.py'
--- hr_attendance/report/attendance_by_month.py	2012-10-21 19:59:25 +0000
+++ hr_attendance/report/attendance_by_month.py	2012-11-01 09:30:26 +0000
@@ -31,6 +31,7 @@
 from report import report_sxw
 from tools import ustr
 from tools.translate import _
+from tools import to_xml
 
 one_day = relativedelta(days=1)
 month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
@@ -106,7 +107,7 @@
         <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))
 
         first_date = str(month)
         som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')

=== modified file 'hr_holidays/report/holidays_summary_report.py'
--- hr_holidays/report/holidays_summary_report.py	2012-06-13 14:26:05 +0000
+++ hr_holidays/report/holidays_summary_report.py	2012-11-01 09:30:26 +0000
@@ -31,6 +31,7 @@
 from report import report_sxw
 from tools import ustr
 from tools.translate import _
+from tools import to_xml
 
 def lengthmonth(year, month):
     if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
@@ -240,7 +241,7 @@
         <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))
 
         # Computing the xml
         xml='''<?xml version="1.0" encoding="UTF-8" ?>

=== modified file 'hr_timesheet/report/user_timesheet.py'
--- hr_timesheet/report/user_timesheet.py	2011-12-19 16:54:40 +0000
+++ hr_timesheet/report/user_timesheet.py	2012-11-01 09:30:26 +0000
@@ -28,6 +28,7 @@
 import pooler
 from report import report_sxw
 from tools import ustr
+from tools import to_xml
 
 def lengthmonth(year, month):
     if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
@@ -94,7 +95,7 @@
             <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,user_id).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,user_id).company_id.name))
 
         account_xml = []
         for account, telems in accounts.iteritems():

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to