[FIX] solved problem of duplication in apprisal survey in hr_evaluation module
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Tue, 29 Nov 2011 09:52:34 +0000 (15:22 +0530)
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Tue, 29 Nov 2011 09:52:34 +0000 (15:22 +0530)
bzr revid: tpa@tinyerp.com-20111129095234-p0d7u8ihfhp706k2

addons/hr_evaluation/hr_evaluation.py
addons/hr_evaluation/hr_evaluation_view.xml

index e1d451c..54a15d5 100644 (file)
@@ -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')}
index d8dfa7e..4bf3ba0 100644 (file)
                                 icon="gtk-execute"/>
                         <button name="button_done" string="Done" states="progress" type="object"
                                 icon="gtk-jump-to"/>
-                        <button name="button_draft" string="Reset to Draft" states="cancel" type="object"
-                                icon="terp-stock_effects-object-colorize"/>
                         <button name="button_final_validation" string="Validate Appraisal" states="wait" type="object"
                                 icon="gtk-go-forward"/>
                     </group>