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
=== 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 @@
31from report import report_sxw31from report import report_sxw
32from tools import ustr32from tools import ustr
33from tools.translate import _33from tools.translate import _
34from tools import to_xml
3435
35one_day = relativedelta(days=1)36one_day = relativedelta(days=1)
36month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']37month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
@@ -106,7 +107,7 @@
106 <date>%s</date>107 <date>%s</date>
107 <company>%s</company>108 <company>%s</company>
108 </header>109 </header>
109 ''' % (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)110 ''' % (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))
110111
111 first_date = str(month)112 first_date = str(month)
112 som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')113 som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')
113114
=== 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 @@
31from report import report_sxw31from report import report_sxw
32from tools import ustr32from tools import ustr
33from tools.translate import _33from tools.translate import _
34from tools import to_xml
3435
35def lengthmonth(year, month):36def lengthmonth(year, month):
36 if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):37 if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
@@ -240,7 +241,7 @@
240 <date>%s</date>241 <date>%s</date>
241 <company>%s</company>242 <company>%s</company>
242 </header>243 </header>
243 ''' % (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)244 ''' % (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))
244245
245 # Computing the xml246 # Computing the xml
246 xml='''<?xml version="1.0" encoding="UTF-8" ?>247 xml='''<?xml version="1.0" encoding="UTF-8" ?>
247248
=== 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 @@
28import pooler28import pooler
29from report import report_sxw29from report import report_sxw
30from tools import ustr30from tools import ustr
31from tools import to_xml
3132
32def lengthmonth(year, month):33def lengthmonth(year, month):
33 if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):34 if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
@@ -94,7 +95,7 @@
94 <date>%s</date>95 <date>%s</date>
95 <company>%s</company>96 <company>%s</company>
96 </header>97 </header>
97 ''' % (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)98 ''' % (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))
9899
99 account_xml = []100 account_xml = []
100 for account, telems in accounts.iteritems():101 for account, telems in accounts.iteritems():

Subscribers

People subscribed via source and target branches

to all changes: