Merge lp:~openerp-dev/openobject-addons/6.1-opw-577041-ado into lp:openobject-addons/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-577041-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 158 lines (+78/-14)
4 files modified
hr_attendance/i18n/hr_attendance.pot (+59/-0)
hr_attendance/report/timesheet.py (+6/-2)
hr_attendance/report/timesheet.xsl (+12/-12)
hr_attendance/wizard/hr_attendance_byweek.py (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-577041-ado
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Pending
Naresh(OpenERP) Pending
Review via email: mp+116427@code.launchpad.net

Description of the change

Hello,

[FIX] (1) The labels in xsl file is not translated in other language while generating the report of attendace_by_week of employee (2) Attendace per week report is generated blank in web_client due to empty ids passed in create_xml method"

Issues:
1). The report "Attendance Per Week" in Employee form contains some static string comes from xsl file is not translated
2). The report "Attendance Per Week" is generated blank while printing with Web-client.
Stpes:
1). Install hr_attendance module with dutch Language
2). Goto : Human Resources/Human Resources/Employees , Print "Attendance Per Week" report with Web-client and test the above issuess

Regards,
Amit Dodiya

To post a comment you must log in.
6914. By Amit Dodiya<email address hidden>

[FIX] (1) The labels in xsl file is not translated in other language while generating the report of attendace_by_week of employee (1) Attendace per week report is generated blank in web_client due to empty ids passed in create_xml method

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-577041-port-mma/+merge/132856 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

6914. By Amit Dodiya<email address hidden>

[FIX] (1) The labels in xsl file is not translated in other language while generating the report of attendace_by_week of employee (1) Attendace per week report is generated blank in web_client due to empty ids passed in create_xml method

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_attendance/i18n/hr_attendance.pot'
2--- hr_attendance/i18n/hr_attendance.pot 2012-02-08 01:08:30 +0000
3+++ hr_attendance/i18n/hr_attendance.pot 2012-07-25 04:56:20 +0000
4@@ -532,3 +532,62 @@
5 msgid "hr.sign.in.out.ask"
6 msgstr ""
7
8+#. module: hr_attendance
9+#: xsl:hr.attendance.allweeks:0
10+msgid "Name:"
11+msgstr ""
12+
13+#. module: hr_attendance
14+#: xsl:hr.attendance.allweeks:0
15+msgid "Mon"
16+msgstr ""
17+
18+#. module: hr_attendance
19+#: xsl:hr.attendance.allweeks:0
20+msgid "Tue"
21+msgstr ""
22+
23+#. module: hr_attendance
24+#: xsl:hr.attendance.allweeks:0
25+msgid "Wed"
26+msgstr ""
27+
28+#. module: hr_attendance
29+#: xsl:hr.attendance.allweeks:0
30+msgid "Thu"
31+msgstr ""
32+
33+#. module: hr_attendance
34+#: xsl:hr.attendance.allweeks:0
35+msgid "Fri"
36+msgstr ""
37+
38+#. module: hr_attendance
39+#: xsl:hr.attendance.allweeks:0
40+msgid "Sat"
41+msgstr ""
42+
43+#. module: hr_attendance
44+#: xsl:hr.attendance.allweeks:0
45+msgid "Sun"
46+msgstr ""
47+
48+#. module: hr_attendance
49+#: xsl:hr.attendance.allweeks:0
50+msgid "Tot"
51+msgstr ""
52+
53+#. module: hr_attendance
54+#: xsl:hr.attendance.allweeks:0
55+msgid "Week:"
56+msgstr ""
57+
58+#. module: hr_attendance
59+#: xsl:hr.attendance.allweeks:0
60+msgid "Worked hours"
61+msgstr ""
62+
63+#. module: hr_attendance
64+#: xsl:hr.attendance.allweeks:0
65+msgid "from "
66+msgstr ""
67
68=== modified file 'hr_attendance/report/timesheet.py'
69--- hr_attendance/report/timesheet.py 2011-04-27 13:08:52 +0000
70+++ hr_attendance/report/timesheet.py 2012-07-25 04:56:20 +0000
71@@ -38,6 +38,7 @@
72
73 def create_xml(self, cr, uid, ids, datas, context=None):
74 obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')
75+ res_lang_obj = pooler.get_pool(cr.dbname).get('res.lang')
76
77 start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
78 end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
79@@ -49,7 +50,7 @@
80
81 user_xml = []
82
83- for employee_id in ids:
84+ for employee_id in datas['active_ids']:
85 emp = obj_emp.read(cr, uid, [employee_id], ['id', 'name'])[0]
86 monday, n_monday = first_monday, first_monday + one_week
87 stop, week_xml = False, []
88@@ -88,7 +89,10 @@
89 ldt = dt
90
91 # Week xml representation
92- week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime('%Y-%m-%d'), '<weekend>%s</weekend>' % n_monday.strftime('%Y-%m-%d')]
93+ user_lang_code = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context).context_lang
94+ lang_id = res_lang_obj.search(cr, uid, [('code', '=', user_lang_code)])
95+ lang_dict = res_lang_obj.read(cr, uid, lang_id, ['date_format'])[0]
96+ week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime(lang_dict.get('date_format')), '<weekend>%s</weekend>' % n_monday.strftime(lang_dict.get('date_format'))]
97 for idx in range(7):
98 week_repr.append('<%s>' % num2day[idx])
99 if idx in week_wh:
100
101=== modified file 'hr_attendance/report/timesheet.xsl'
102--- hr_attendance/report/timesheet.xsl 2011-01-14 00:11:01 +0000
103+++ hr_attendance/report/timesheet.xsl 2012-07-25 04:56:20 +0000
104@@ -41,30 +41,30 @@
105
106 <xsl:template match="user">
107 <para>
108- <b>Name:</b>
109+ <b t="1">Name:</b>
110 <i><xsl:value-of select="name" /></i>
111 </para>
112 <blockTable colWidths="4cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm" style="week">
113 <tr>
114 <td></td>
115- <td>Mon</td>
116- <td>Tue</td>
117- <td>Wed</td>
118- <td>Thu</td>
119- <td>Fri</td>
120- <td>Sat</td>
121- <td>Sun</td>
122- <td>Tot</td>
123+ <td t="1">Mon</td>
124+ <td t="1">Tue</td>
125+ <td t="1">Wed</td>
126+ <td t="1">Thu</td>
127+ <td t="1">Fri</td>
128+ <td t="1">Sat</td>
129+ <td t="1">Sun</td>
130+ <td t="1">Tot</td>
131 </tr>
132 <xsl:for-each select="week">
133 <tr></tr>
134 <tr>
135- <td>Week:</td>
136+ <td t="1">Week:</td>
137 <td></td>
138- <td>from <xsl:value-of select="weekstart" /> to <xsl:value-of select="weekend" /></td>
139+ <td t="1">from <xsl:value-of select="weekstart" /> to <xsl:value-of select="weekend" /></td>
140 </tr>
141 <tr>
142- <td>Worked hours</td>
143+ <td t="1">Worked hours</td>
144 <td>
145 <xsl:choose>
146 <xsl:when test="Monday/workhours">
147
148=== modified file 'hr_attendance/wizard/hr_attendance_byweek.py'
149--- hr_attendance/wizard/hr_attendance_byweek.py 2011-01-14 00:11:01 +0000
150+++ hr_attendance/wizard/hr_attendance_byweek.py 2012-07-25 04:56:20 +0000
151@@ -38,6 +38,7 @@
152 datas = {
153 'ids': [],
154 'model': 'hr.employee',
155+ 'active_ids': context['active_ids'],
156 'form': self.read(cr, uid, ids)[0]
157 }
158 return {