[Fix]in the absence of an Applicant's Name, employee should take first contact name and then take subject name as applicant name

bzr revid: vja@tinyerp.com-20130215064248-j206q2aw2g8ainir
This commit is contained in:
Vishmita 2013-02-15 12:12:48 +05:30
parent 31f6d8a024
commit 13ad265864
2 changed files with 8 additions and 10 deletions

View File

@ -420,12 +420,13 @@ class hr_applicant(base_stage, osv.Model):
act_window = self.pool.get('ir.actions.act_window')
emp_id = False
for applicant in self.browse(cr, uid, ids, context=context):
address_id = False
address_id = contact_name = False
if applicant.partner_id:
address_id = self.pool.get('res.partner').address_get(cr,uid,[applicant.partner_id.id],['contact'])['contact']
contact_name = self.pool.get('res.partner').name_get(cr,uid,[applicant.partner_id.id])[0][1]
if applicant.job_id:
applicant.job_id.write({'no_of_recruitment': applicant.job_id.no_of_recruitment - 1})
emp_id = hr_employee.create(cr,uid,{'name': applicant.partner_name or applicant.name,
emp_id = hr_employee.create(cr,uid,{'name': applicant.partner_name or contact_name or applicant.name,
'job_id': applicant.job_id.id,
'address_home_id': address_id,
'department_id': applicant.department_id.id

View File

@ -255,15 +255,12 @@ class hr_timesheet_line(osv.osv):
def create_timesheet(self, cr, uid, vals,context=None):
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
print"this >>>>>>>>>>>>>>>>>>>>>>>>",vals,sheet_obj.search(cr, uid,[('date_to', '>=', vals['date']), ('date_from', '<=', vals['date'])])
idss = sheet_obj.search(cr, uid,[('date_to', '>=', vals['date']), ('date_from', '<=', vals['date'])])
print"this 123 >>>>>>>>>>>>>>>>>>>>>>>>",idss
if not idss or len(idss) < 1 :
sheet_ids = sheet_obj.search(cr, uid,[('date_to', '>=', vals['date']), ('date_from', '<=', vals['date'])])
if not sheet_ids or len(sheet_ids) < 1 :
res = sheet_obj.default_get(cr, uid, ['date_from','date_to','employee_id','company_id','state'], context=None)
ids = sheet_obj.create(cr, uid, res, context=None)
print"this >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>...343424",ids,res
return ids
return idss
id = sheet_obj.create(cr, uid, res, context=None)
return id
return sheet_ids
def _sheet(self, cursor, user, ids, name, args, context=None):
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')