From bee7aabb044619af2af858a03fcce88ae24a873b Mon Sep 17 00:00:00 2001 From: jam-openerp Date: Thu, 14 Oct 2010 15:27:26 +0530 Subject: [PATCH] [FIX] hr_evaluation Changing the dead line of request based on Evaluation bzr revid: jam@tinyerp.com-20101014095726-ng4zipv3cqo074k4 --- addons/hr_evaluation/hr_evaluation.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 960849bdfd4..3bb159eb0fe 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -267,7 +267,21 @@ class hr_evaluation(osv.osv): context = {} self.write(cr, uid, ids,{'state':'cancel'}, context=context) return True - + + def write(self, cr, uid, ids, vals, context=None): + if context is None: + context = {} + if 'date' in vals: + new_vals = {} + obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview') + current_record = self.browse(cr, uid, ids, context=context)[0] + survey_requests = current_record.survey_request_ids + new_vals.update({'date_deadline':vals.get('date')}) + if survey_requests: + for survey_req in survey_requests: + obj_hr_eval_iterview.write(cr, uid, survey_req.id, new_vals,context=context) + return super(hr_evaluation, self).write(cr, uid, ids, vals, context=context) + hr_evaluation() class survey_request(osv.osv):