[IMP] hr_timesheet_sheet: Improved onchange_employee_id method.

bzr revid: uco@tinyerp.com-20110617125952-m1xbspu0j2d81g5e
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-06-17 18:29:52 +05:30
parent 8f34b9bc5f
commit 461c89b180
1 changed files with 3 additions and 6 deletions

View File

@ -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()