[IMP] hr_timesheet_sheet, hr_timesheet_invoice : made changes for warning message

bzr revid: cha@tinyerp.com-20120927121948-iqrtxdijiknwggh6
This commit is contained in:
Ajay Chauhan (OpenERP) 2012-09-27 17:49:48 +05:30
parent 3636c648c1
commit b478be2675
2 changed files with 3 additions and 1 deletions

View File

@ -135,6 +135,8 @@ class account_analytic_line(osv.osv):
def _default_general_account(self, cr, uid, context=None):
proxy = self.pool.get('hr.employee')
record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
if not len(record_ids):
raise osv.except_osv(_('Error!'), _('Please create an employee and associate it with this user.'))
employee = proxy.browse(cr, uid, record_ids[0], context=context)
if employee.product_id and employee.product_id.property_account_income:
return employee.product_id.property_account_income.id

View File

@ -35,7 +35,7 @@ class hr_timesheet_current_open(osv.osv_memory):
user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
if not len(user_ids):
raise osv.except_osv(_('Error!'), _('Please define employee for your user!'))
raise osv.except_osv(_('Error!'), _('Please create an employee and associate it with this user.'))
ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context)
if len(ids) > 1: