From 708c8a1ccab2175cbd85e3354bd6ddb43132bc9a Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 14 Mar 2011 14:40:03 +0530 Subject: [PATCH] [FIX] hr_timesheet_sheet: Cannot use the timesheet program because of a warning message Please Enter A Value lp bug: https://launchpad.net/bugs/724201 fixed bzr revid: ara@tinyerp.com-20110314091003-v8zxjg9l56wcussd --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 34134942e0a..bf93700fc6a 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -177,6 +177,10 @@ class hr_timesheet_sheet(osv.osv): if 'employee_id' in vals: if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id: raise osv.except_osv(_('Error !'), _('You cannot create a timesheet for an employee that does not have any user defined !')) + if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id: + raise osv.except_osv(_('Error !'), _('You cannot create a timesheet for an employee that does not have any product defined !')) + if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id: + raise osv.except_osv(_('Error !'), _('You cannot create a timesheet for an employee that does not have any analytic journal defined !')) return super(hr_timesheet_sheet, self).create(cr, uid, vals, *args, **argv) def write(self, cr, uid, ids, vals, *args, **argv):