[IMP] hr_recruitment: spellcheck, simplify mail compose wizard
bzr revid: odo@openerp.com-20110907183328-lkmn6roww23atp9e
This commit is contained in:
@@ -31,6 +31,8 @@ import tools
|
||||
from tools.translate import _
|
||||
from crm import wizard
|
||||
|
||||
wizard.mail_compose_message.SUPPORTED_MODELS.append('hr.applicant')
|
||||
|
||||
AVAILABLE_STATES = [
|
||||
('draft', 'New'),
|
||||
('open', 'In Progress'),
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<group attrs="{'invisible': [('email_from', '=', False)]}">
|
||||
<field name="body" colspan="4" nolabel="1" height="250"/>
|
||||
<field name="body_text" colspan="4" nolabel="1" height="250"/>
|
||||
<button colspan="4" string="Reply"
|
||||
name="%(mail.action_email_compose_message_wizard)d"
|
||||
context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_recruitment_stage_user","hr.recruitment.stage.user","model_hr_recruitment_stage","base.group_hr_user",1,1,1,1
|
||||
"access_hr_recruitment_degree","hr.recruitment.degree","model_hr_recruitment_degree","base.group_hr_user",1,1,1,1
|
||||
"access_email_message_user","email.message.user","mail.model_email_message","base.group_hr_user",1,1,1,1
|
||||
"access_mail_message_user","mail.message.user","mail.model_mail_message","base.group_hr_user",1,1,1,1
|
||||
"access_res_partner_hr_user","res.partner.user","base.model_res_partner","base.group_hr_user",1,1,1,1
|
||||
"access_res_partner_address_hr_user","res.partner.address.user","base.model_res_partner_address","base.group_hr_user",1,1,1,1
|
||||
"access_survey_hr_user","survey.hr.user","survey.model_survey","base.group_hr_user",1,1,1,0
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
import hr_recruitment_phonecall
|
||||
import hr_recruitment_create_partner_job
|
||||
import hr_recruitment_employee_hired
|
||||
import email_compose_message
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv
|
||||
from osv import fields
|
||||
import tools
|
||||
|
||||
|
||||
class email_compose_message(osv.osv_memory):
|
||||
_inherit = 'mail.compose.message'
|
||||
|
||||
def get_value(self, cr, uid, model, resource_id, context=None):
|
||||
'''
|
||||
To get values of the resource_id for the model
|
||||
@param model: Object
|
||||
@param resource_id: id of a record for which values to be read
|
||||
|
||||
@return: Returns a dictionary
|
||||
'''
|
||||
if context is None:
|
||||
context = {}
|
||||
result = super(email_compose_message, self).get_value(cr, uid, model, resource_id, context=context)
|
||||
if model == 'hr.applicant' and resource_id:
|
||||
model_obj = self.pool.get(model)
|
||||
data = model_obj.browse(cr, uid , resource_id, context)
|
||||
result.update({
|
||||
'subject' : data.name or False,
|
||||
'email_to' : data.email_from or False,
|
||||
'email_from' : data.user_id and data.user_id.address_id and data.user_id.address_id.email or False,
|
||||
'body_text' : '\n' + (tools.ustr(data.user_id.signature or '')),
|
||||
'email_cc' : tools.ustr(data.email_cc or ''),
|
||||
'model': model,
|
||||
'res_id': resource_id,
|
||||
})
|
||||
return result
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
Reference in New Issue
Block a user