From 8ffac40122e60587b3645c933fc1e779eb828a8d Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 17 Feb 2011 10:56:05 +0530 Subject: [PATCH] [FIX] hr_evaluation: add draft button on evaluation form when it got canceled lp bug: https://launchpad.net/bugs/720221 fixed bzr revid: mra@mra-laptop-20110217052605-v6ni6uqw50xkguh9 --- addons/hr_evaluation/hr_evaluation.py | 4 +++ addons/hr_evaluation/hr_evaluation_view.xml | 34 +++++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 4a9a46920f5..0b0ebb92261 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -251,6 +251,10 @@ class hr_evaluation(osv.osv): 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 99f34f7cc7b..ac3f723ceb3 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -200,16 +200,18 @@ - - -