From 663030a591c018ddabbbf105c4993830ff611ddf Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Tue, 29 Nov 2011 15:22:34 +0530 Subject: [PATCH] [FIX] solved problem of duplication in apprisal survey in hr_evaluation module bzr revid: tpa@tinyerp.com-20111129095234-p0d7u8ihfhp706k2 --- addons/hr_evaluation/hr_evaluation.py | 7 +++---- addons/hr_evaluation/hr_evaluation_view.xml | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index e1d451c9f7f..54a15d5593c 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -250,13 +250,12 @@ class hr_evaluation(osv.osv): return True def button_cancel(self, cr, uid, ids, context=None): + interview_obj=self.pool.get('hr.evaluation.interview') + evaluation = self.browse(cr, uid, ids[0], context) + interview_obj.survey_req_cancel(cr, uid, [r.id for r in evaluation.survey_request_ids]) self.write(cr, uid, ids,{'state':'cancel'}, context=context) return True - def button_draft(self, cr, uid, ids, context=None): - self.write(cr, uid, ids,{'state': 'draft'}, context=context) - return True - def write(self, cr, uid, ids, vals, context=None): if 'date' in vals: new_vals = {'date_deadline': vals.get('date')} diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index d8dfa7e40ca..4bf3ba0fff7 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -207,8 +207,6 @@ icon="gtk-execute"/>