HR_TIMESHEET: add exception if employee haven't product

bzr revid: ced-c656f5b534e1cacd27ba512e39a6bc338e6f345c
ced 2006-12-21 07:42:18 +00:00
parent 51411f3706
commit 617c86ad20
1 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,10 @@ class hr_analytic_timesheet(osv.osv):
emp_obj = self.pool.get('hr.employee')
emp_id =, uid, [('user_id', '=', uid)])
if emp_id:
return emp_obj.browse(cr, uid, emp_id[0], context)
emp=emp_obj.browse(cr, uid, emp_id[0], context)
if not emp.product_id:
raise osv.except_osv('No product !', "The employee haven't an associated product")
return False
def _getGeneralAccount(self, cr, uid, context):