From 37b6165dd4eed6c23963d2eff511aa3f62618d13 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 5 Jul 2012 13:55:21 +0200 Subject: [PATCH] [REM] hr_recruitment: remove unused wizard hr.recruitment.job2phonecall bzr revid: rco@openerp.com-20120705115521-ox4hpbqfbrfcsbd0 --- addons/hr_recruitment/__openerp__.py | 1 - addons/hr_recruitment/wizard/__init__.py | 1 - .../wizard/hr_recruitment_phonecall.py | 126 ------------------ .../wizard/hr_recruitment_phonecall_view.xml | 40 ------ 4 files changed, 168 deletions(-) delete mode 100644 addons/hr_recruitment/wizard/hr_recruitment_phonecall.py delete mode 100644 addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py index b83a482e1c1..a340cc18dc7 100644 --- a/addons/hr_recruitment/__openerp__.py +++ b/addons/hr_recruitment/__openerp__.py @@ -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', diff --git a/addons/hr_recruitment/wizard/__init__.py b/addons/hr_recruitment/wizard/__init__.py index acabd219857..fde7df63456 100644 --- a/addons/hr_recruitment/wizard/__init__.py +++ b/addons/hr_recruitment/wizard/__init__.py @@ -20,7 +20,6 @@ ############################################################################## -import hr_recruitment_phonecall import hr_recruitment_create_partner_job import hr_recruitment_employee_hired diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py deleted file mode 100644 index 12c294c20bc..00000000000 --- a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py +++ /dev/null @@ -1,126 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). 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 . -# -############################################################################## -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: diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml deleted file mode 100644 index 8537186ac6f..00000000000 --- a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - hr.recruitment.job2phonecall.form - hr.recruitment.job2phonecall - form - -
-
-
- - - - - - - - - - -
-
-
- - - Schedule Phone Call - ir.actions.act_window - hr.recruitment.job2phonecall - form - form - new - - -
-