Merge lp:~openerp-dev/openobject-addons/trunk-opw-576075-port-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Merged
Merged at revision: 8001
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-576075-port-mma
Merge into: lp:openobject-addons
Diff against target: 62 lines (+6/-3)
3 files modified
hr_attendance/report/attendance_by_month.py (+2/-1)
hr_holidays/report/holidays_summary_report.py (+2/-1)
hr_timesheet/report/user_timesheet.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-576075-port-mma
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+132476@code.launchpad.net

Description of the change

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

To post a comment you must log in.

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 2012-10-21 19:59:25 +0000
3+++ hr_attendance/report/attendance_by_month.py 2012-11-01 09:30:26 +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@@ -106,7 +107,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 2012-06-13 14:26:05 +0000
24+++ hr_holidays/report/holidays_summary_report.py 2012-11-01 09:30:26 +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@@ -240,7 +241,7 @@
34 <date>%s</date>
35 <company>%s</company>
36 </header>
37- ''' % (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)
38+ ''' % (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))
39
40 # Computing the xml
41 xml='''<?xml version="1.0" encoding="UTF-8" ?>
42
43=== modified file 'hr_timesheet/report/user_timesheet.py'
44--- hr_timesheet/report/user_timesheet.py 2011-12-19 16:54:40 +0000
45+++ hr_timesheet/report/user_timesheet.py 2012-11-01 09:30:26 +0000
46@@ -28,6 +28,7 @@
47 import pooler
48 from report import report_sxw
49 from tools import ustr
50+from tools import to_xml
51
52 def lengthmonth(year, month):
53 if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
54@@ -94,7 +95,7 @@
55 <date>%s</date>
56 <company>%s</company>
57 </header>
58- ''' % (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)
59+ ''' % (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))
60
61 account_xml = []
62 for account, telems in accounts.iteritems():

Subscribers

People subscribed via source and target branches

to all changes: