1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>
20 ##############################################################################
23 from osv import fields
25 from tools.translate import _
27 class mail_compose_message(osv.osv_memory):
28 _inherit = 'mail.compose.message'
30 def get_value(self, cr, uid, model, resource_id, context=None):
32 To get values of the resource_id for the model
34 @param resource_id: id of a record for which values to be read
36 @return: Returns a dictionary
40 result = super(mail_compose_message, self).get_value(cr, uid, model, resource_id, context=context)
41 if model == 'hr.evaluation.interview' and resource_id:
42 model_pool = self.pool.get(model)
43 record_data = model_pool.browse(cr, uid, resource_id, context)
44 if record_data.state == "waiting_answer":
45 msg = _("Hello %s, \n\n Kindly post your response for '%s' survey interview. \n\n Thanks,") %(record_data.user_to_review_id.name, record_data.survey_id.title)
47 'email_to': record_data.user_to_review_id.work_email or False,
48 'subject': _("Reminder to fill up Survey"),
54 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: