Skip to content

Commit 3d9e5a7

Browse files
Alexis de Lattrealexis-via
Alexis de Lattre
authored andcommitted
Very large changes in the structure of the project :
- move more asterisk-independant code to base_phone module and create new asterisk-independant modules - rename module asterisk_popup to base_phone_popup - add ability to get callerid names not only from partners, but also from leads, employees, applicants, etc... - same for auto pop-up : not only for partners, but also for leads, employees, etc...
1 parent 72dbdc9 commit 3d9e5a7

File tree

5 files changed

+151
-0
lines changed

5 files changed

+151
-0
lines changed

hr_recruitment_phone/__init__.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
##############################################################################
3+
#
4+
# HR Recruitment Phone module for Odoo/OpenERP
5+
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU Affero General Public License as
9+
# published by the Free Software Foundation, either version 3 of the
10+
# License, or (at your option) any later version.
11+
#
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 Affero General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Affero General Public License
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
#
20+
##############################################################################
21+
22+
from . import hr_recruitment_phone

hr_recruitment_phone/__openerp__.py

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# -*- encoding: utf-8 -*-
2+
##############################################################################
3+
#
4+
# HR Recruitment Phone module for OpenERP
5+
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU Affero General Public License as
9+
# published by the Free Software Foundation, either version 3 of the
10+
# License, or (at your option) any later version.
11+
#
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 Affero General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Affero General Public License
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
#
20+
##############################################################################
21+
22+
23+
{
24+
'name': 'HR Recruitment Phone',
25+
'version': '0.1',
26+
'category': 'Phone',
27+
'license': 'AGPL-3',
28+
'summary': 'Validate phone numbers in HR Recruitment',
29+
'description': """
30+
HR Recruitment Phone
31+
====================
32+
33+
This module validate phone numbers in the HR Recruitment module, just like the *base_phone* module valide phone numbers in the Partner form. Please refer to the description of the *base_phone* module for more information.
34+
35+
This module is independant from the Asterisk connector.
36+
37+
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
38+
""",
39+
'author': 'Akretion',
40+
'website': 'http://www.akretion.com/',
41+
'depends': ['base_phone', 'hr_recruitment'],
42+
'data': [
43+
'security/ir.model.access.csv',
44+
'hr_recruitment_view.xml',
45+
],
46+
'images': [],
47+
'installable': True,
48+
'active': False,
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -*- encoding: utf-8 -*-
2+
##############################################################################
3+
#
4+
# HR Recruitment phone module for Odoo/OpenERP
5+
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com)
6+
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU Affero General Public License as published
10+
# by the Free Software Foundation, either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU Affero General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU Affero General Public License
19+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
#
21+
##############################################################################
22+
23+
from openerp.osv import orm
24+
25+
26+
class hr_applicant(orm.Model):
27+
_name = 'hr.applicant'
28+
_inherit = ['hr.applicant', 'phone.common']
29+
30+
def create(self, cr, uid, vals, context=None):
31+
vals_reformated = self._generic_reformat_phonenumbers(
32+
cr, uid, vals, context=context)
33+
return super(hr_applicant, self).create(
34+
cr, uid, vals_reformated, context=context)
35+
36+
def write(self, cr, uid, ids, vals, context=None):
37+
vals_reformated = self._generic_reformat_phonenumbers(
38+
cr, uid, vals, context=context)
39+
return super(hr_applicant, self).write(
40+
cr, uid, ids, vals_reformated, context=context)
41+
42+
43+
class phone_common(orm.AbstractModel):
44+
_inherit = 'phone.common'
45+
46+
def _get_phone_fields(self, cr, uid, context=None):
47+
res = super(phone_common, self)._get_phone_fields(
48+
cr, uid, context=context)
49+
res['hr.applicant'] = {
50+
'phonefields': ['partner_phone', 'partner_mobile'],
51+
'get_name_sequence': 50,
52+
}
53+
return res
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
4+
The licence is in the file __openerp__.py
5+
-->
6+
7+
<openerp>
8+
<data>
9+
10+
<record id="crm_case_form_view_job" model="ir.ui.view">
11+
<field name="name">hr_recruitment_phone.hr_applicant.form</field>
12+
<field name="model">hr.applicant</field>
13+
<field name="inherit_id" ref="hr_recruitment.crm_case_form_view_job"/>
14+
<field name="arch" type="xml">
15+
<field name="partner_phone" position="attributes">
16+
<attribute name="widget">phone</attribute>
17+
</field>
18+
<field name="partner_mobile" position="attributes">
19+
<attribute name="widget">phone</attribute>
20+
</field>
21+
</field>
22+
</record>
23+
24+
</data>
25+
</openerp>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
callerid_hr_applicant_read,Read access on hr.applicant,hr_recruitment.model_hr_applicant,base_phone.group_callerid,1,0,0,0

0 commit comments

Comments
 (0)