From 8091ee95b746db97acd3a3382c672a81a4ddb663 Mon Sep 17 00:00:00 2001 From: "Jignesh Rathod (OpenERP)" Date: Tue, 11 Jun 2013 10:58:30 +0530 Subject: [PATCH] Add Module. bzr revid: jir@tinyerp.com-20130611052830-j9svn7ei0cn10l85 --- addons/hr_applicant_document/__init__.py | 24 +++++++++ addons/hr_applicant_document/__openerp__.py | 47 +++++++++++++++++ .../hr_applicant_document.py | 48 +++++++++++++++++ .../hr_applicant_document_view.xml | 51 +++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 addons/hr_applicant_document/__init__.py create mode 100644 addons/hr_applicant_document/__openerp__.py create mode 100644 addons/hr_applicant_document/hr_applicant_document.py create mode 100644 addons/hr_applicant_document/hr_applicant_document_view.xml diff --git a/addons/hr_applicant_document/__init__.py b/addons/hr_applicant_document/__init__.py new file mode 100644 index 00000000000..d3188eef79a --- /dev/null +++ b/addons/hr_applicant_document/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: 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 hr_applicant_document + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_applicant_document/__openerp__.py b/addons/hr_applicant_document/__openerp__.py new file mode 100644 index 00000000000..537856c54a0 --- /dev/null +++ b/addons/hr_applicant_document/__openerp__.py @@ -0,0 +1,47 @@ +# -*- encoding: 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 . +# +############################################################################## + +{ + 'name': 'Applicant Resumes and Letters', + 'version': '1.0', + 'category': 'Human Resources', + 'sequence': 25, + 'summary': 'Applicant Resumes and Letters', + 'description': """ +Manage Applicant Resumes and letters +==================================== +This application allows you to keep resumes and letters with applicants. + +""", + 'author': 'OpenERP SA', + 'website': 'http://www.openerp.com', + 'images': ['images/hr_recruitment_analysis.jpeg','images/hr_recruitment_applicants.jpeg'], + 'depends': ['hr_recruitment','document'], + 'data': ['hr_applicant_document_view.xml'], + 'demo': [], + 'test': [], + 'installable': True, + 'auto_install': True, + 'application': True, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_applicant_document/hr_applicant_document.py b/addons/hr_applicant_document/hr_applicant_document.py new file mode 100644 index 00000000000..5675d87d473 --- /dev/null +++ b/addons/hr_applicant_document/hr_applicant_document.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 openerp import tools +from openerp.addons.base_status.base_stage import base_stage +from datetime import datetime +from openerp.osv import fields, osv +from openerp.tools.translate import _ +from openerp.tools import html2plaintext +class applicant_document(osv.osv): + _name = 'hr.applicant' + _inherit = 'hr.applicant' + def _get_index_content(self, cr, uid, ids, fields, args, context=None): + res = {} + attachment_pool = self.pool.get('ir.attachment') + for issue in self.browse(cr, uid, ids, context=context): + res[issue.id] = 0 + attach_id = attachment_pool.search(cr, uid, [('res_model','=','hr.applicant'),('res_id','=',issue.id)]) + if attach_id: + for attach in attachment_pool.browse(cr, uid, attach_id, context): + res[issue.id] = attach.index_content + return res + + _columns = { + 'index_content': fields.function(_get_index_content, string='Index Content', \ + type="char",store=True), + } +applicant_document() + diff --git a/addons/hr_applicant_document/hr_applicant_document_view.xml b/addons/hr_applicant_document/hr_applicant_document_view.xml new file mode 100644 index 00000000000..c590c5c89fe --- /dev/null +++ b/addons/hr_applicant_document/hr_applicant_document_view.xml @@ -0,0 +1,51 @@ + + + + + + Applicants + hr.applicant + + + + + + + + + + Jobs - Recruitment Search + hr.applicant + + + + + + + + + + + Resumes and Letters + ir.attachment + tree,form + + [('res_model','=','hr.applicant')] + +

+ Search through resumes and motivation letters. +

+
+
+ + + + + +
+
+ +