[IMP] When Employee created relatevent Appraisal create with evaluation date if already set.

bzr revid: tta@openerp.com-20121130081541-og07m4bkjoqny4et
This commit is contained in:
Tejas Tank 2012-11-30 13:15:41 +05:00
parent e3a89f4fb2
commit 2db99b7b8b
1 changed files with 5 additions and 1 deletions

View File

@ -135,8 +135,12 @@ class hr_employee(osv.osv):
def create(self, cr, uid, vals, context=None):
id = super(hr_employee, self).create(cr, uid, vals, context=context)
hre_vals = {'employee_id': id}
if vals.get('evaluation_date', False):
hre_vals['date'] = vals['evaluation_date']
if vals.get('evaluation_plan_id', False):
self.pool.get('hr_evaluation.evaluation').create(cr, uid, {'employee_id': id, 'plan_id': vals['evaluation_plan_id']}, context=context)
hre_vals['plan_id'] = vals['evaluation_plan_id']
self.pool.get('hr_evaluation.evaluation').create(cr, uid, hre_vals, context=context)
return id
hr_employee()