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

Proposed by Mayur Maheshwari(OpenERP)
Status: Superseded
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-578618-port-mma
Merge into: lp:openobject-addons
Diff against target: 23 lines (+4/-2)
1 file modified
hr_timesheet/wizard/hr_timesheet_sign_in_out.py (+4/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-578618-port-mma
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+135144@code.launchpad.net

This proposal has been superseded by a proposal from 2012-12-20.

Description of the change

Hello,

steps to reproduce

- Install hr_timesheet, hr_attendance
- Install lang other than English,
- Goto menu: `Human Resources --> Attendances`, and process `Sign in / Sign out` and `Sign in / Sign out by project` wizards,

You will find values for `state` field as `absent` and `present` which should not be translated.
This fix will enable translation for these two words by replacing keys with string.
code is forward port from 6.1

Thanks,
Mayur

To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

you should better change the state field into a selection instead of a char field.

8082. By Mayur Maheshwari(OpenERP)

[IMP]hr_timesheet: added selcetion type instead of a char field

Unmerged revisions

8082. By Mayur Maheshwari(OpenERP)

[IMP]hr_timesheet: added selcetion type instead of a char field

8081. By Ravi Gohil (OpenERP)

[FIX]hr_timesheet: word absent and present is not returned translated in wizard

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet/wizard/hr_timesheet_sign_in_out.py'
2--- hr_timesheet/wizard/hr_timesheet_sign_in_out.py 2012-10-24 20:14:24 +0000
3+++ hr_timesheet/wizard/hr_timesheet_sign_in_out.py 2012-11-20 12:58:24 +0000
4@@ -43,7 +43,8 @@
5 emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
6 if emp_ids:
7 for employee in emp_obj.browse(cr, uid, emp_ids, context=context):
8- return {'name': employee.name, 'state': employee.state, 'emp_id': emp_ids[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
9+ state = _('Present') if employee.state == 'present' else _('Absent')
10+ return {'name': employee.name, 'state': state, 'emp_id': emp_ids[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
11
12 def _get_empid2(self, cr, uid, context=None):
13 res = self._get_empid(cr, uid, context=context)
14@@ -165,7 +166,8 @@
15 emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
16 if emp_id:
17 for employee in emp_obj.browse(cr, uid, emp_id, context=context):
18- res.update({'name': employee.name, 'state': employee.state, 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')})
19+ state = _('Present') if employee.state == 'present' else _('Absent')
20+ res.update({'name': employee.name, 'state': state, 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')})
21 return res
22
23 hr_si_project()

Subscribers

People subscribed via source and target branches

to all changes: