diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index bf6790c6be3..af2f5f07179 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -220,9 +220,34 @@ class hr_timesheet_sheet(osv.osv):
if employee_id:
department_id = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).department_id.id
return {'value': {'department_id': department_id}}
-
+
hr_timesheet_sheet()
+class hr_employee(osv.osv):
+ _inherit = "hr.employee"
+
+ def open_timesheet(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ employee = self.browse(cr, uid, ids[0], context)
+ view_context = {
+ 'search_default_employee_id' : [employee.id],
+ 'default_employee_id' : employee.id,
+ 'default_user_id': employee.user_id.id,
+ }
+ value = {
+ 'name': _('Timesheets'),
+ 'context': view_context,
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr_timesheet_sheet.sheet',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window'
+ }
+ return value
+
+hr_employee()
+
class account_analytic_line(osv.osv):
_inherit = "account.analytic.line"
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 6de6be6c08d..06779e73472 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -351,21 +351,13 @@
-
- hr_timesheet_sheet.sheet
- form
- Timesheets
- tree,form
- {'search_default_employee_id': [active_id], 'default_employee_id': active_id}
-
-
hr.timesheet.sheet.employee.extd_form
hr.employee
-
+