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
=== modified file 'hr_attendance/i18n/hr_attendance.pot'
--- hr_attendance/i18n/hr_attendance.pot 2012-02-08 01:08:30 +0000
+++ hr_attendance/i18n/hr_attendance.pot 2012-07-25 04:56:20 +0000
@@ -532,3 +532,62 @@
532msgid "hr.sign.in.out.ask"532msgid "hr.sign.in.out.ask"
533msgstr ""533msgstr ""
534534
535#. module: hr_attendance
536#: xsl:hr.attendance.allweeks:0
537msgid "Name:"
538msgstr ""
539
540#. module: hr_attendance
541#: xsl:hr.attendance.allweeks:0
542msgid "Mon"
543msgstr ""
544
545#. module: hr_attendance
546#: xsl:hr.attendance.allweeks:0
547msgid "Tue"
548msgstr ""
549
550#. module: hr_attendance
551#: xsl:hr.attendance.allweeks:0
552msgid "Wed"
553msgstr ""
554
555#. module: hr_attendance
556#: xsl:hr.attendance.allweeks:0
557msgid "Thu"
558msgstr ""
559
560#. module: hr_attendance
561#: xsl:hr.attendance.allweeks:0
562msgid "Fri"
563msgstr ""
564
565#. module: hr_attendance
566#: xsl:hr.attendance.allweeks:0
567msgid "Sat"
568msgstr ""
569
570#. module: hr_attendance
571#: xsl:hr.attendance.allweeks:0
572msgid "Sun"
573msgstr ""
574
575#. module: hr_attendance
576#: xsl:hr.attendance.allweeks:0
577msgid "Tot"
578msgstr ""
579
580#. module: hr_attendance
581#: xsl:hr.attendance.allweeks:0
582msgid "Week:"
583msgstr ""
584
585#. module: hr_attendance
586#: xsl:hr.attendance.allweeks:0
587msgid "Worked hours"
588msgstr ""
589
590#. module: hr_attendance
591#: xsl:hr.attendance.allweeks:0
592msgid "from "
593msgstr ""
535594
=== modified file 'hr_attendance/report/timesheet.py'
--- hr_attendance/report/timesheet.py 2011-04-27 13:08:52 +0000
+++ hr_attendance/report/timesheet.py 2012-07-25 04:56:20 +0000
@@ -38,6 +38,7 @@
3838
39 def create_xml(self, cr, uid, ids, datas, context=None):39 def create_xml(self, cr, uid, ids, datas, context=None):
40 obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')40 obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')
41 res_lang_obj = pooler.get_pool(cr.dbname).get('res.lang')
4142
42 start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')43 start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
43 end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')44 end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
@@ -49,7 +50,7 @@
4950
50 user_xml = []51 user_xml = []
5152
52 for employee_id in ids:53 for employee_id in datas['active_ids']:
53 emp = obj_emp.read(cr, uid, [employee_id], ['id', 'name'])[0]54 emp = obj_emp.read(cr, uid, [employee_id], ['id', 'name'])[0]
54 monday, n_monday = first_monday, first_monday + one_week55 monday, n_monday = first_monday, first_monday + one_week
55 stop, week_xml = False, []56 stop, week_xml = False, []
@@ -88,7 +89,10 @@
88 ldt = dt89 ldt = dt
8990
90 # Week xml representation91 # Week xml representation
91 week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime('%Y-%m-%d'), '<weekend>%s</weekend>' % n_monday.strftime('%Y-%m-%d')]92 user_lang_code = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context).context_lang
93 lang_id = res_lang_obj.search(cr, uid, [('code', '=', user_lang_code)])
94 lang_dict = res_lang_obj.read(cr, uid, lang_id, ['date_format'])[0]
95 week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime(lang_dict.get('date_format')), '<weekend>%s</weekend>' % n_monday.strftime(lang_dict.get('date_format'))]
92 for idx in range(7):96 for idx in range(7):
93 week_repr.append('<%s>' % num2day[idx])97 week_repr.append('<%s>' % num2day[idx])
94 if idx in week_wh:98 if idx in week_wh:
9599
=== modified file 'hr_attendance/report/timesheet.xsl'
--- hr_attendance/report/timesheet.xsl 2011-01-14 00:11:01 +0000
+++ hr_attendance/report/timesheet.xsl 2012-07-25 04:56:20 +0000
@@ -41,30 +41,30 @@
4141
42 <xsl:template match="user">42 <xsl:template match="user">
43 <para>43 <para>
44 <b>Name:</b>44 <b t="1">Name:</b>
45 <i><xsl:value-of select="name" /></i>45 <i><xsl:value-of select="name" /></i>
46 </para>46 </para>
47 <blockTable colWidths="4cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm" style="week">47 <blockTable colWidths="4cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm,1.5cm" style="week">
48 <tr>48 <tr>
49 <td></td>49 <td></td>
50 <td>Mon</td>50 <td t="1">Mon</td>
51 <td>Tue</td>51 <td t="1">Tue</td>
52 <td>Wed</td>52 <td t="1">Wed</td>
53 <td>Thu</td>53 <td t="1">Thu</td>
54 <td>Fri</td>54 <td t="1">Fri</td>
55 <td>Sat</td>55 <td t="1">Sat</td>
56 <td>Sun</td>56 <td t="1">Sun</td>
57 <td>Tot</td>57 <td t="1">Tot</td>
58 </tr>58 </tr>
59 <xsl:for-each select="week">59 <xsl:for-each select="week">
60 <tr></tr>60 <tr></tr>
61 <tr>61 <tr>
62 <td>Week:</td>62 <td t="1">Week:</td>
63 <td></td>63 <td></td>
64 <td>from <xsl:value-of select="weekstart" /> to <xsl:value-of select="weekend" /></td>64 <td t="1">from <xsl:value-of select="weekstart" /> to <xsl:value-of select="weekend" /></td>
65 </tr>65 </tr>
66 <tr>66 <tr>
67 <td>Worked hours</td>67 <td t="1">Worked hours</td>
68 <td>68 <td>
69 <xsl:choose>69 <xsl:choose>
70 <xsl:when test="Monday/workhours">70 <xsl:when test="Monday/workhours">
7171
=== modified file 'hr_attendance/wizard/hr_attendance_byweek.py'
--- hr_attendance/wizard/hr_attendance_byweek.py 2011-01-14 00:11:01 +0000
+++ hr_attendance/wizard/hr_attendance_byweek.py 2012-07-25 04:56:20 +0000
@@ -38,6 +38,7 @@
38 datas = {38 datas = {
39 'ids': [],39 'ids': [],
40 'model': 'hr.employee',40 'model': 'hr.employee',
41 'active_ids': context['active_ids'],
41 'form': self.read(cr, uid, ids)[0]42 'form': self.read(cr, uid, ids)[0]
42 }43 }
43 return {44 return {