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
26 class email_compose_message(osv.osv_memory):
27 _inherit = 'email.compose.message'
29 def get_value(self, cr, uid, model, resource_id, context=None):
31 To get values of the resource_id for the model
33 @param resource_id: id of a record for which values to be read
35 @return: Returns a dictionary
39 result = super(email_compose_message, self).get_value(cr, uid, model, resource_id, context=context)
40 if model == 'crm.helpdesk' and resource_id:
41 model_obj = self.pool.get(model)
42 data = model_obj.browse(cr, uid , resource_id, context)
44 'subject' : data.name or False,
45 'email_to' : data.email_from or False,
46 'email_from' : data.user_id and data.user_id.address_id and data.user_id.address_id.email or False,
47 'body_text' : '\n' + (tools.ustr(data.user_id.signature or '')),
48 'email_cc' : tools.ustr(data.email_cc or ''),
50 'res_id': resource_id,
54 email_compose_message()
56 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: