diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 6daf74aedc6..90d9bd0bd09 100755 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -102,7 +102,8 @@ class hr_employee(osv.osv): 'address_id': fields.many2one('res.partner.address', 'Working Address'), 'address_home_id': fields.many2one('res.partner.address', 'Home Address'), 'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone'), - 'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail'), + 'work_email': fields.char('Work E-mail', size=240), +# 'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail'), 'work_location': fields.char('Office Location', size=32), 'notes': fields.text('Notes'), diff --git a/addons/hr_evaluation/__init__.py b/addons/hr_evaluation/__init__.py index e8abcb28e1d..178e7dd69a3 100644 --- a/addons/hr_evaluation/__init__.py +++ b/addons/hr_evaluation/__init__.py @@ -20,6 +20,7 @@ ############################################################################## import hr_evaluation +import wizard import report diff --git a/addons/hr_evaluation/__terp__.py b/addons/hr_evaluation/__terp__.py index ef0ec48c094..780ddd290df 100644 --- a/addons/hr_evaluation/__terp__.py +++ b/addons/hr_evaluation/__terp__.py @@ -38,8 +38,9 @@ "demo_xml" : ["hr_evaluation_demo.xml"], "update_xml" : [ "security/ir.model.access.csv", + "wizard/hr_evaluation_mail_view.xml", "hr_evaluation_view.xml", - "hr_evaluation_data.xml", + "hr_evaluation_demo.xml", "report/hr_evaluation_report_view.xml"], "active": False, "installable": True diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 984536f40f1..10e4d6475a5 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -209,7 +209,7 @@ class hr_evaluation(osv.osv): val = { 'employee_name':child.name, 'user_signature':curr_employee.name, - 'company_name':user_obj_id.company_id.name, +# 'company_name':user_obj_id.company_id.name, 'eval_name':phase.survey_id.title, 'date':time.strftime('%Y-%m-%d'), } @@ -233,7 +233,7 @@ class hr_evaluation(osv.osv): val.update({'employee_name':manager_employee.name}) mailbody = hr_eval_plan_obj.read(cr,uid,phase.id,['mail_body'],context=context) body = mailbody['mail_body']%val - dest = [child.work_email] + dest = [manager_employee.work_email] if dest: tools.email_send(src,dest,sub,body) apprai_id.append(id) @@ -300,9 +300,10 @@ class hr_evaluation_interview(osv.osv): def survey_req_waiting_answer(self, cr, uid, ids, context={}): self.write(cr, uid, ids, { 'state' : 'waiting_answer'}) # for id in self.browse(cr, uid, ids): -# if id.user_id and id.user_id.address_id and id.user_id.address_id and id.user_id.address_id.email: -# msg = " Hello %s, \n\n We are inviting you for %s survey. \n\n Thanks," %(id.user_id.name, id.survey_id.title) -# tools.email_send(tools.config['email_from'], [id.user_id.address_id.email],\ +# print"id",id +# if id.user_to_review_id and id.user_to_review_id.work_email: +# msg = " Hello %s, \n\n We are inviting you for %s survey. \n\n Thanks," %(id.user_to_review_id.name, id.survey_id.title) +# tools.email_send(tools.config['email_from'], [id.user_to_review_id.work_email],\ # 'Invite to fill up Survey', msg) return True @@ -335,4 +336,5 @@ class hr_evaluation_interview(osv.osv): self.write(cr, uid, ids, { 'state' : 'cancel'}, context=context) return True -hr_evaluation_interview() \ No newline at end of file +hr_evaluation_interview() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1 \ No newline at end of file diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index a9b5606b2cc..21aaa5473ee 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -44,7 +44,7 @@ - - + + + + @@ -320,5 +326,9 @@ id="menu_open_hr_evaluation_interview_requests" action="action_hr_evaluation_interview_tree"/> + diff --git a/addons/hr_evaluation/wizard/__init__.py b/addons/hr_evaluation/wizard/__init__.py new file mode 100644 index 00000000000..367cabbe90b --- /dev/null +++ b/addons/hr_evaluation/wizard/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import hr_evaluation_mail + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py new file mode 100644 index 00000000000..42b0654de1b --- /dev/null +++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py @@ -0,0 +1,43 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields, osv +import tools + +class hr_evaluation_reminder(osv.osv_memory): + _name = "hr.evaluation.reminder" + _description = "Sends Reminders to employess to fill the evaluations" + _columns = { + 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluations', required=True) + } + + def send_mail(self, cr, uid, ids, context={}): + hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation') + evaluation_data = self.read(cr, uid, ids, context=context)[0] + for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids: + if waiting_id.state == "waiting_answer" and waiting_id.user_to_review_id.work_email : + msg = " Hello %s, \n\n Kindly post your response for %s survey. \n\n Thanks," %(waiting_id.user_to_review_id.name, waiting_id.survey_id.title) + tools.email_send(tools.config['email_from'], [waiting_id.user_to_review_id.work_email],\ + 'Reminder to fill up Survey', msg) + return {'type': 'ir.actions.act_window_close'} + +hr_evaluation_reminder() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail_view.xml b/addons/hr_evaluation/wizard/hr_evaluation_mail_view.xml new file mode 100644 index 00000000000..fff55095712 --- /dev/null +++ b/addons/hr_evaluation/wizard/hr_evaluation_mail_view.xml @@ -0,0 +1,31 @@ + + + + + + hr.evaluation.send.mail + hr.evaluation.reminder + form + +
+ + +