diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 02ba6d6dd68..a8cda50bd0f 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -383,13 +383,10 @@ class hr_timesheet_sheet(osv.osv): return super(hr_timesheet_sheet, self).unlink(cr, uid, ids, context=context) def onchange_employee_id(self, cr, uid, ids, employee_id, context=None): - res = {'value':{}} + department_id = False if employee_id: - department_id = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).department_id.id or False - res['value'] = { - 'department_id': department_id, - } - return res + 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()