[REM] hr_recruitment: remove unused wizard hr.recruitment.job2phonecall

bzr revid: rco@openerp.com-20120705115521-ox4hpbqfbrfcsbd0
This commit is contained in:
Raphael Collet 2012-07-05 13:55:21 +02:00
parent 50dbf218c2
commit 37b6165dd4
4 changed files with 0 additions and 168 deletions

View File

@ -46,7 +46,6 @@ system to store and search in your CV base.
'fetchmail',
],
'update_xml': [
'wizard/hr_recruitment_phonecall_view.xml',
'wizard/hr_recruitment_employee_hired.xml',
'wizard/hr_recruitment_create_partner_job_view.xml',
'hr_recruitment_view.xml',

View File

@ -20,7 +20,6 @@
##############################################################################
import hr_recruitment_phonecall
import hr_recruitment_create_partner_job
import hr_recruitment_employee_hired

View File

@ -1,126 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import osv, fields
from tools.translate import _
class job2phonecall(osv.osv_memory):
_name = 'hr.recruitment.job2phonecall'
_description = 'Schedule Phone Call'
_columns = {
'user_id': fields.many2one('res.users', 'Assign To'),
'deadline': fields.datetime('Planned Date'),
'note': fields.text('Goals'),
'category_id': fields.many2one('crm.case.categ', 'Category', required=True),
}
def _date_user(self, cr, uid, context=None):
case_obj = self.pool.get('hr.applicant')
if context is None:
context = {}
case = case_obj.browse(cr, uid, context.get('active_id', False), context=context)
return case.user_id and case.user_id.id or False
def _date_category(self, cr, uid, context=None):
case_obj = self.pool.get('hr.applicant')
if context is None:
context = {}
case = case_obj.browse(cr, uid, context.get('active_id', False), context=context)
categ_id = self.pool.get('crm.case.categ').search(cr, uid, [('name','=','Outbound')], context=context)
return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False
def _get_note(self, cr, uid, context=None):
mail_message = self.pool.get('mail.message')
if context is None:
context = {}
if context.get('active_id'):
case = self.pool.get('hr.applicant').browse(cr, uid, context['active_id'], context=context)
if case.description:
return case.description
else:
msg_ids = mail_message.search(cr, uid, [('model', '=', 'hr.applicant'), ('res_id', '=', case.id), ('email_from', '!=', ''), ('email_to', '!=', '')], limit=1)
if msg_ids:
return mail_message.browse(cr, uid, msg_ids[0], context=context).body_text
return False
_defaults = {
'user_id': _date_user,
'category_id': _date_category,
'note': _get_note
}
def make_phonecall(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
job_case_obj = self.pool.get('hr.applicant')
data_obj = self.pool.get('ir.model.data')
phonecall_case_obj = self.pool.get('crm.phonecall')
if context is None:
context = {}
form = self.browse(cr, uid, ids, context=context)[0]
result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter')
res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
# Select the view
id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_tree_view')
id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_form_view')
if id2:
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
if id3:
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
new_phonecall_id = []
for job in job_case_obj.browse(cr, uid, context.get('active_ids', []), context=context):
#TODO: Take other info from job
new_phonecall_id = phonecall_case_obj.create(cr, uid, {
'name': job.name,
'user_id': form.user_id.id,
'categ_id': form.category_id.id,
'description': form.note,
'date': form.deadline,
'description': job.description,
'partner_id': job.partner_id.id,
'partner_phone': job.partner_phone,
'partner_mobile': job.partner_mobile,
'description': job.description,
'date':job.date,
}, context=context)
new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id, context=context)
vals = {}
job_case_obj.write(cr, uid, [job.id], vals, context=context)
# job_case_obj.case_cancel(cr, uid, [job.id])
phonecall_case_obj.case_open(cr, uid, [new_phonecall_id])
return {
'name': _('Phone Call'),
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'crm.phonecall',
'res_id': new_phonecall_id,
'views': [(id3,'form'), (id2,'tree'), (False,'calendar'), (False,'graph')],
'type': 'ir.actions.act_window',
'search_view_id': res['res_id']
}
job2phonecall()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_recruitment_phonecall" model="ir.ui.view">
<field name="name">hr.recruitment.job2phonecall.form</field>
<field name="model">hr.recruitment.job2phonecall</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Schedule Phone Call" version="7.0">
<header>
<button name="make_phonecall" string="Schedule Phone Call" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group col="4" colspan="6">
<separator string="Phone Call Description" colspan="4" />
<newline />
<field name='user_id' />
<field name='deadline' />
<newline />
<field name='note' colspan="4"/>
<newline />
<field name='category_id' domain="[('object_id.model', '=', 'crm.phonecall')]"/>
</group>
</form>
</field>
</record>
<record id="action_hr_recruitment_phonecall" model="ir.actions.act_window">
<field name="name">Schedule Phone Call</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.recruitment.job2phonecall</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</data>
</openerp>