Hemendra Paregi(Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.1-opw-576075-hpa into
lp:openobject-addons/6.1.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576075-hpa/+merge/111161
Hello
Faced the traceback while opening the HR related reports:
"Employee's Holidays",
"Attendance By Month",
"Employee Timesheet"
"Employees Timesheet"
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/Timesheet/Employee Timesheet
->Go to Human Resources/Reporting/Timesheet/Employees Timesheet
-> ERROR
This fixes the above issues
Thanks
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576075-hpa/+merge/111161
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.1-opw-576075-hpa.
=== modified file 'hr_attendance/report/attendance_by_month.py'
--- hr_attendance/report/attendance_by_month.py 2011-12-16 05:52:38 +0000
+++ hr_attendance/report/attendance_by_month.py 2012-06-20 07:43:22 +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']
@@ -104,7 +105,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 2011-10-16 01:28:00 +0000
+++ hr_holidays/report/holidays_summary_report.py 2012-06-20 07:43:22 +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))):
@@ -229,13 +230,13 @@
dept_done=1
emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, item['id'], item['name'], som, eom)
row_id = row_id +1
-
+
header_xml = '''
<header>
<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-06-20 07:43:22 +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():
=== modified file 'hr_timesheet/report/users_timesheet.py'
--- hr_timesheet/report/users_timesheet.py 2011-06-21 09:51:17 +0000
+++ hr_timesheet/report/users_timesheet.py 2012-06-20 07:43:22 +0000
@@ -27,6 +27,7 @@
from tools.translate import _
from report import report_sxw
from tools import ustr
+from tools import to_xml
def lengthmonth(year, month):
@@ -104,7 +105,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))
xml='''<?xml version="1.0" encoding="UTF-8" ?>
<report>
_______________________________________________
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