Merge lp:~openerp-dev/openobject-addons/6.1-opw-576075-hpa into lp:openobject-addons/6.1

Proposed by Hemendra Paregi (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6851
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-576075-hpa
Merge into: lp:openobject-addons/6.1
Diff against target: 90 lines (+9/-5)
4 files modified
hr_attendance/report/attendance_by_month.py (+2/-1)
hr_holidays/report/holidays_summary_report.py (+3/-2)
hr_timesheet/report/user_timesheet.py (+2/-1)
hr_timesheet/report/users_timesheet.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-576075-hpa
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+111161@code.launchpad.net

Description of the change

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

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576075-port-mma/+merge/132476 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6851. By Hemendra Paregi (OpenERP)

[FIX] HR : Company name with '&' throws error when opening report' (Case:576075)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_attendance/report/attendance_by_month.py'
2--- hr_attendance/report/attendance_by_month.py 2011-12-16 05:52:38 +0000
3+++ hr_attendance/report/attendance_by_month.py 2012-06-20 07:43:22 +0000
4@@ -31,6 +31,7 @@
5 from report import report_sxw
6 from tools import ustr
7 from tools.translate import _
8+from tools import to_xml
9
10 one_day = relativedelta(days=1)
11 month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
12@@ -104,7 +105,7 @@
13 <date>%s</date>
14 <company>%s</company>
15 </header>
16- ''' % (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)
17+ ''' % (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))
18
19 first_date = str(month)
20 som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')
21
22=== modified file 'hr_holidays/report/holidays_summary_report.py'
23--- hr_holidays/report/holidays_summary_report.py 2011-10-16 01:28:00 +0000
24+++ hr_holidays/report/holidays_summary_report.py 2012-06-20 07:43:22 +0000
25@@ -31,6 +31,7 @@
26 from report import report_sxw
27 from tools import ustr
28 from tools.translate import _
29+from tools import to_xml
30
31 def lengthmonth(year, month):
32 if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
33@@ -229,13 +230,13 @@
34 dept_done=1
35 emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, item['id'], item['name'], som, eom)
36 row_id = row_id +1
37-
38+
39 header_xml = '''
40 <header>
41 <date>%s</date>
42 <company>%s</company>
43 </header>
44- ''' % (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)
45+ ''' % (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))
46
47 # Computing the xml
48 xml='''<?xml version="1.0" encoding="UTF-8" ?>
49
50=== modified file 'hr_timesheet/report/user_timesheet.py'
51--- hr_timesheet/report/user_timesheet.py 2011-12-19 16:54:40 +0000
52+++ hr_timesheet/report/user_timesheet.py 2012-06-20 07:43:22 +0000
53@@ -28,6 +28,7 @@
54 import pooler
55 from report import report_sxw
56 from tools import ustr
57+from tools import to_xml
58
59 def lengthmonth(year, month):
60 if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
61@@ -94,7 +95,7 @@
62 <date>%s</date>
63 <company>%s</company>
64 </header>
65- ''' % (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)
66+ ''' % (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))
67
68 account_xml = []
69 for account, telems in accounts.iteritems():
70
71=== modified file 'hr_timesheet/report/users_timesheet.py'
72--- hr_timesheet/report/users_timesheet.py 2011-06-21 09:51:17 +0000
73+++ hr_timesheet/report/users_timesheet.py 2012-06-20 07:43:22 +0000
74@@ -27,6 +27,7 @@
75 from tools.translate import _
76 from report import report_sxw
77 from tools import ustr
78+from tools import to_xml
79
80
81 def lengthmonth(year, month):
82@@ -104,7 +105,7 @@
83 <date>%s</date>
84 <company>%s</company>
85 </header>
86- ''' % (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)
87+ ''' % (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))
88
89 xml='''<?xml version="1.0" encoding="UTF-8" ?>
90 <report>