Browse Source
Very large changes in the structure of the project :
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...pull/7/head
Alexis de Lattre
10 years ago
68 changed files with 1238 additions and 436 deletions
-
3asterisk_click2dial/__openerp__.py
-
86asterisk_click2dial/asterisk_click2dial.py
-
29asterisk_click2dial/asterisk_server_view.xml
-
7asterisk_click2dial/res_partner_view.xml
-
51asterisk_click2dial/res_users_view.xml
-
26asterisk_click2dial/scripts/get_cid_name.py
-
2asterisk_click2dial/security/ir.model.access.csv
-
31asterisk_click2dial/wizard/open_calling_partner.py
-
5asterisk_click2dial_crm/__openerp__.py
-
17asterisk_click2dial_crm/asterisk_click2dial_crm.py
-
6asterisk_click2dial_crm/crm_lead_view.xml
-
23asterisk_click2dial_crm/res_users_view.xml
-
1asterisk_click2dial_crm/wizard/__init__.py
-
1asterisk_click2dial_crm/wizard/create_crm_phonecall_view.xml
-
39asterisk_click2dial_crm/wizard/reformat_all_phonenumbers.py
-
1asterisk_click2dial_crm_claim/__init__.py
-
4asterisk_click2dial_crm_claim/__openerp__.py
-
4asterisk_click2dial_crm_claim/crm_claim_view.xml
-
1asterisk_click2dial_crm_claim/wizard/__init__.py
-
2asterisk_click2dial_crm_claim/wizard/open_calling_partner.py
-
39asterisk_click2dial_crm_claim/wizard/reformat_all_phonenumbers.py
-
1asterisk_click2dial_event/__init__.py
-
4asterisk_click2dial_event/__openerp__.py
-
0asterisk_click2dial_event/asterisk_click2dial_registration.py
-
20asterisk_click2dial_event/registration_view.xml
-
0asterisk_click2dial_event/wizard/__init__.py
-
2asterisk_click2dial_event/wizard/open_calling_partner.py
-
0asterisk_click2dial_event/wizard/open_calling_partner_view.xml
-
36asterisk_popup/res_users_view.xml
-
2base_phone/__init__.py
-
6base_phone/__openerp__.py
-
153base_phone/base_phone.py
-
27base_phone/res_company_view.xml
-
40base_phone/res_users_view.xml
-
2base_phone/security/ir.model.access.csv
-
8base_phone/security/phone_security.xml
-
63base_phone/wizard/reformat_all_phonenumbers.py
-
13base_phone/wizard/reformat_all_phonenumbers_view.xml
-
2base_phone_popup/__init__.py
-
17base_phone_popup/__openerp__.py
-
0base_phone_popup/i18n/asterisk_popup.pot
-
0base_phone_popup/i18n/fr.po
-
39base_phone_popup/popup.py
-
39base_phone_popup/res_users_view.xml
-
22crm_claim_phone/__init__.py
-
46crm_claim_phone/__openerp__.py
-
39crm_claim_phone/crm_claim_phone.py
-
23crm_claim_phone/crm_claim_view.xml
-
22crm_phone/__init__.py
-
49crm_phone/__openerp__.py
-
98crm_phone/crm_phone.py
-
59crm_phone/crm_view.xml
-
2crm_phone/security/ir.model.access.csv
-
22event_phone/__init__.py
-
49event_phone/__openerp__.py
-
53event_phone/event_phone.py
-
34event_phone/event_view.xml
-
2event_phone/security/ir.model.access.csv
-
22hr_phone/__init__.py
-
49hr_phone/__openerp__.py
-
53hr_phone/hr_phone.py
-
25hr_phone/hr_view.xml
-
2hr_phone/security/ir.model.access.csv
-
22hr_recruitment_phone/__init__.py
-
49hr_recruitment_phone/__openerp__.py
-
53hr_recruitment_phone/hr_recruitment_phone.py
-
25hr_recruitment_phone/hr_recruitment_view.xml
-
2hr_recruitment_phone/security/ir.model.access.csv
@ -1,5 +1,3 @@ |
|||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
||||
ir_model_access_asterisk_server_user,Read access on asterisk.server,model_asterisk_server,base.group_user,1,0,0,0 |
ir_model_access_asterisk_server_user,Read access on asterisk.server,model_asterisk_server,base.group_user,1,0,0,0 |
||||
ir_model_access_asterisk_server_system,Full rights on asterisk.server,model_asterisk_server,base.group_system,1,1,1,1 |
ir_model_access_asterisk_server_system,Full rights on asterisk.server,model_asterisk_server,base.group_system,1,1,1,1 |
||||
asterisk_cid_res_partner_read,Read access on res.partner,base.model_res_partner,group_asterisk_cid,1,0,0,0 |
|
||||
asterisk_cid_asterisk_server_read,Read access on asterisk.server,model_asterisk_server,group_asterisk_cid,1,0,0,0 |
|
@ -1,39 +0,0 @@ |
|||||
# -*- encoding: utf-8 -*- |
|
||||
############################################################################## |
|
||||
# |
|
||||
# Asterisk click2dial CRM module for OpenERP |
|
||||
# Copyright (c) 2013-2014 Akretion (http://www.akretion.com) |
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
|
||||
# |
|
||||
# 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/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
from openerp.osv import orm |
|
||||
|
|
||||
|
|
||||
class reformat_all_phonenumbers(orm.TransientModel): |
|
||||
_inherit = "reformat.all.phonenumbers" |
|
||||
|
|
||||
def _extend_reformat_phonenumbers(self, cr, uid, context=None): |
|
||||
res = super( |
|
||||
reformat_all_phonenumbers, self)._extend_reformat_phonenumbers( |
|
||||
cr, uid, context=context) |
|
||||
res[self.pool['crm.lead']] = { |
|
||||
'allids': self.pool['crm.lead'].search( |
|
||||
cr, uid, [], context=context), |
|
||||
'phonefields': ['phone', 'fax', 'mobile'], |
|
||||
'namefield': 'partner_name', |
|
||||
} |
|
||||
return res |
|
@ -1,39 +0,0 @@ |
|||||
# -*- encoding: utf-8 -*- |
|
||||
############################################################################## |
|
||||
# |
|
||||
# Asterisk click2dial CRM Claim module for OpenERP |
|
||||
# Copyright (c) 2013-2014 Akretion (http://www.akretion.com) |
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
|
||||
# |
|
||||
# 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/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
from openerp.osv import orm |
|
||||
|
|
||||
|
|
||||
class reformat_all_phonenumbers(orm.TransientModel): |
|
||||
_inherit = "reformat.all.phonenumbers" |
|
||||
|
|
||||
def _extend_reformat_phonenumbers(self, cr, uid, context=None): |
|
||||
res = super( |
|
||||
reformat_all_phonenumbers, self)._extend_reformat_phonenumbers( |
|
||||
cr, uid, context=context) |
|
||||
res[self.pool['crm.claim']] = { |
|
||||
'allids': self.pool['crm.claim'].search( |
|
||||
cr, uid, [], context=context), |
|
||||
'phonefields': ['partner_phone'], |
|
||||
'namefield': 'name', |
|
||||
} |
|
||||
return res |
|
@ -1,36 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<!-- |
|
||||
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
|
||||
The licence is in the file __openerp__.py |
|
||||
--> |
|
||||
|
|
||||
<openerp> |
|
||||
<data> |
|
||||
|
|
||||
<record id="asterisk_res_users" model="ir.ui.view"> |
|
||||
<field name="name">asterisk.popup.res.users.form</field> |
|
||||
<field name="model">res.users</field> |
|
||||
<field name="inherit_id" ref="asterisk_click2dial.asterisk_res_users_internal_number"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<field name="asterisk_server_id" position="after"> |
|
||||
<field name="context_incall_popup"/> |
|
||||
</field> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record id="view_users_form_simple_modif" model="ir.ui.view"> |
|
||||
<field name="name">asterisk.popup.preferences.view</field> |
|
||||
<field name="model">res.users</field> |
|
||||
<field name="inherit_id" ref="asterisk_click2dial.view_users_form_simple_modif" /> |
|
||||
<field name="arch" type="xml"> |
|
||||
<group name="telephony" position="inside"> |
|
||||
<field name="context_incall_popup" readonly="0"/> |
|
||||
</group> |
|
||||
<group name="telephony" position="attributes"> |
|
||||
<attribute name="string">Telephony Preferences</attribute> |
|
||||
</group> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
@ -0,0 +1,27 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
|
||||
|
<!-- |
||||
|
Copyright (C) 2014 Akretion (http://www.akretion.com/) |
||||
|
@author Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_company_form" model="ir.ui.view"> |
||||
|
<field name="name">base_phone.company.form</field> |
||||
|
<field name="model">res.company</field> |
||||
|
<field name="inherit_id" ref="base.view_company_form" /> |
||||
|
<field name="arch" type="xml"> |
||||
|
<group name="account_grp" position="after"> |
||||
|
<group name="phone" string="Phone"> |
||||
|
<field name="number_of_digits_to_match_from_end" /> |
||||
|
</group> |
||||
|
</group> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,40 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Base Phone module for OpenERP |
||||
|
Copyright (C) 2010-2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_users_form" model="ir.ui.view"> |
||||
|
<field name="name">base_phone.res.users.telephony_tab</field> |
||||
|
<field name="model">res.users</field> |
||||
|
<field name="inherit_id" ref="base.view_users_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<notebook> |
||||
|
<page string="Telephony" name="phone" invisible="1" position="inside"> |
||||
|
<!-- Empty page, which will be used by other phone modules --> |
||||
|
<group name="phone-preferences" string="Telephony Preferences"> |
||||
|
</group> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="view_users_form_simple_modif" model="ir.ui.view"> |
||||
|
<field name="name">base_phone.user_preferences.view</field> |
||||
|
<field name="model">res.users</field> |
||||
|
<field name="inherit_id" ref="base.view_users_form_simple_modif" /> |
||||
|
<field name="arch" type="xml"> |
||||
|
<group string="Email Preferences" position="after"> |
||||
|
<group name="phone" string="Telephony Preferences" invisible="1"> |
||||
|
<!-- Empty group, that is used by other phone modules --> |
||||
|
</group> |
||||
|
</group> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,2 @@ |
|||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
||||
|
callerid_res_partner_read,Read access on res.partner,base.model_res_partner,group_callerid,1,0,0,0 |
@ -1,7 +1,7 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################## |
############################################################################## |
||||
# |
# |
||||
# Asterisk Pop-up module for OpenERP |
|
||||
|
# Base Phone Pop-up module for Odoo/OpenERP |
||||
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
# |
# |
||||
# This program is free software: you can redistribute it and/or modify |
# This program is free software: you can redistribute it and/or modify |
@ -0,0 +1,39 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_users_form" model="ir.ui.view"> |
||||
|
<field name="name">base_phone_popup.res.users.form</field> |
||||
|
<field name="model">res.users</field> |
||||
|
<field name="inherit_id" ref="base_phone.view_users_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<page name="phone" position="attributes"> |
||||
|
<attribute name="invisible">0</attribute> |
||||
|
</page> |
||||
|
<group name="phone-preferences" position="inside"> |
||||
|
<field name="context_incall_popup"/> |
||||
|
</group> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="view_users_form_simple_modif" model="ir.ui.view"> |
||||
|
<field name="name">base_phone_popup.users.preferences.view</field> |
||||
|
<field name="model">res.users</field> |
||||
|
<field name="inherit_id" ref="base_phone.view_users_form_simple_modif" /> |
||||
|
<field name="arch" type="xml"> |
||||
|
<group name="phone" position="inside"> |
||||
|
<field name="context_incall_popup" readonly="0"/> |
||||
|
</group> |
||||
|
<group name="phone" position="attributes"> |
||||
|
<attribute name="invisible">0</attribute> |
||||
|
</group> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# CRM Claim Phone module for Odoo/OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import crm_claim_phone |
@ -0,0 +1,46 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# CRM Claim Phone module for Odoo/OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
|
||||
|
{ |
||||
|
'name': 'CRM Claim Phone', |
||||
|
'version': '0.1', |
||||
|
'category': 'Phone', |
||||
|
'license': 'AGPL-3', |
||||
|
'summary': 'Validate phone numbers in CRM Claims', |
||||
|
'description': """ |
||||
|
CRM Claims Phone |
||||
|
================ |
||||
|
|
||||
|
This module validate phone numbers in the CRM Claim 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. |
||||
|
|
||||
|
This module is independant from the Asterisk connector. |
||||
|
|
||||
|
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module. |
||||
|
""", |
||||
|
'author': 'Akretion', |
||||
|
'website': 'http://www.akretion.com/', |
||||
|
'depends': ['base_phone', 'crm_claim'], |
||||
|
'data': ['crm_claim_view.xml'], |
||||
|
'images': [], |
||||
|
'installable': True, |
||||
|
'active': False, |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
CRM Claim Phone module for OpenERP |
||||
|
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="crm_case_claims_form_view" model="ir.ui.view"> |
||||
|
<field name="name">crm_claim_phone.crm_claim.form</field> |
||||
|
<field name="model">crm.claim</field> |
||||
|
<field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="partner_phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# CRM Phone module for Odoo/OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import crm_phone |
@ -0,0 +1,49 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# CRM Phone module for OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
|
||||
|
{ |
||||
|
'name': 'CRM Phone', |
||||
|
'version': '0.1', |
||||
|
'category': 'Phone', |
||||
|
'license': 'AGPL-3', |
||||
|
'summary': 'Validate phone numbers in CRM', |
||||
|
'description': """ |
||||
|
CRM Phone |
||||
|
========= |
||||
|
|
||||
|
This module validate phone numbers in the CRM 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. |
||||
|
|
||||
|
This module is independant from the Asterisk connector. |
||||
|
|
||||
|
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module. |
||||
|
""", |
||||
|
'author': 'Akretion', |
||||
|
'website': 'http://www.akretion.com/', |
||||
|
'depends': ['base_phone', 'crm'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'crm_view.xml', |
||||
|
], |
||||
|
'images': [], |
||||
|
'installable': True, |
||||
|
'active': False, |
||||
|
} |
@ -0,0 +1,98 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# CRM phone module for Odoo/OpenERP |
||||
|
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com) |
||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp.osv import orm |
||||
|
|
||||
|
|
||||
|
class crm_lead(orm.Model): |
||||
|
_name = 'crm.lead' |
||||
|
_inherit = ['crm.lead', 'phone.common'] |
||||
|
|
||||
|
def create(self, cr, uid, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(crm_lead, self).create( |
||||
|
cr, uid, vals_reformated, context=context) |
||||
|
|
||||
|
def write(self, cr, uid, ids, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(crm_lead, self).write( |
||||
|
cr, uid, ids, vals_reformated, context=context) |
||||
|
|
||||
|
def name_get(self, cr, uid, ids, context=None): |
||||
|
if context is None: |
||||
|
context = {} |
||||
|
if context.get('callerid'): |
||||
|
res = [] |
||||
|
if isinstance(ids, (int, long)): |
||||
|
ids = [ids] |
||||
|
for lead in self.browse(cr, uid, ids, context=context): |
||||
|
if lead.partner_name and lead.contact_name: |
||||
|
name = u'%s (%s)' % (lead.contact_name, lead.partner_name) |
||||
|
elif lead.partner_name: |
||||
|
name = lead.partner_name |
||||
|
elif lead.contact_name: |
||||
|
name = lead.contact_name |
||||
|
else: |
||||
|
name = lead.name |
||||
|
res.append((lead.id, name)) |
||||
|
return res |
||||
|
else: |
||||
|
return super(crm_lead, self).name_get( |
||||
|
cr, uid, ids, context=context) |
||||
|
|
||||
|
|
||||
|
class crm_phonecall(orm.Model): |
||||
|
_name = 'crm.phonecall' |
||||
|
_inherit = ['crm.phonecall', 'phone.common'] |
||||
|
|
||||
|
def create(self, cr, uid, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(crm_phonecall, self).create( |
||||
|
cr, uid, vals_reformated, context=context) |
||||
|
|
||||
|
def write(self, cr, uid, ids, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(crm_phonecall, self).write( |
||||
|
cr, uid, ids, vals_reformated, context=context) |
||||
|
|
||||
|
|
||||
|
class phone_common(orm.AbstractModel): |
||||
|
_inherit = 'phone.common' |
||||
|
|
||||
|
def _get_phone_fields(self, cr, uid, context=None): |
||||
|
res = super(phone_common, self)._get_phone_fields( |
||||
|
cr, uid, context=context) |
||||
|
res.update({ |
||||
|
'crm.lead': { |
||||
|
'phonefields': ['phone', 'mobile'], |
||||
|
'faxfields': ['fax'], |
||||
|
'get_name_sequence': 20, |
||||
|
}, |
||||
|
'crm.phonecall': { |
||||
|
'phonefields': ['partner_phone', 'partner_mobile'], |
||||
|
}, |
||||
|
}) |
||||
|
return res |
@ -0,0 +1,59 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="crm_case_form_view_leads" model="ir.ui.view"> |
||||
|
<field name="name">crm_phone.crm_lead.form</field> |
||||
|
<field name="model">crm.lead</field> |
||||
|
<field name="inherit_id" ref="crm.crm_case_form_view_leads"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
<field name="mobile" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
<field name="fax" position="attributes"> |
||||
|
<attribute name="widget">fax</attribute> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="crm_case_form_view_oppor" model="ir.ui.view"> |
||||
|
<field name="name">crm_phone.case.view_opportuniy.form</field> |
||||
|
<field name="model">crm.lead</field> |
||||
|
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
<field name="mobile" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
<field name="fax" position="attributes"> |
||||
|
<attribute name="widget">fax</attribute> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="crm_case_phone_form_view" model="ir.ui.view"> |
||||
|
<field name="name">crm_phone.crm_phonecall.form</field> |
||||
|
<field name="model">crm.phonecall</field> |
||||
|
<field name="inherit_id" ref="crm.crm_case_phone_form_view"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="partner_phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
<field name="partner_mobile" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,2 @@ |
|||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
||||
|
callerid_crm_lead_read,Read access on crm.lead,crm.model_crm_lead,base_phone.group_callerid,1,0,0,0 |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Event Phone module for Odoo/OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import event_phone |
@ -0,0 +1,49 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Event Phone module for Odoo/OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
|
||||
|
{ |
||||
|
'name': 'Event Phone', |
||||
|
'version': '0.1', |
||||
|
'category': 'Phone', |
||||
|
'license': 'AGPL-3', |
||||
|
'summary': 'Validate phone numbers in Events', |
||||
|
'description': """ |
||||
|
Event Phone |
||||
|
=========== |
||||
|
|
||||
|
This module validate phone numbers in the Event 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. |
||||
|
|
||||
|
This module is independant from the Asterisk connector. |
||||
|
|
||||
|
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module. |
||||
|
""", |
||||
|
'author': 'Akretion', |
||||
|
'website': 'http://www.akretion.com/', |
||||
|
'depends': ['base_phone', 'event'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'event_view.xml', |
||||
|
], |
||||
|
'images': [], |
||||
|
'installable': True, |
||||
|
'active': False, |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Event phone module for Odoo/OpenERP |
||||
|
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com) |
||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp.osv import orm |
||||
|
|
||||
|
|
||||
|
class event_registration(orm.Model): |
||||
|
_name = 'event.registration' |
||||
|
_inherit = ['event.registration', 'phone.common'] |
||||
|
|
||||
|
def create(self, cr, uid, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(event_registration, self).create( |
||||
|
cr, uid, vals_reformated, context=context) |
||||
|
|
||||
|
def write(self, cr, uid, ids, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(event_registration, self).write( |
||||
|
cr, uid, ids, vals_reformated, context=context) |
||||
|
|
||||
|
|
||||
|
class phone_common(orm.AbstractModel): |
||||
|
_inherit = 'phone.common' |
||||
|
|
||||
|
def _get_phone_fields(self, cr, uid, context=None): |
||||
|
res = super(phone_common, self)._get_phone_fields( |
||||
|
cr, uid, context=context) |
||||
|
res['event.registration'] = { |
||||
|
'phonefields': ['phone'], |
||||
|
'get_name_sequence': 100, |
||||
|
} |
||||
|
return res |
@ -0,0 +1,34 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_event_registration_form" model="ir.ui.view"> |
||||
|
<field name="name">event_phone.event_registration.form</field> |
||||
|
<field name="model">event.registration</field> |
||||
|
<field name="inherit_id" ref="event.view_event_registration_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="view_event_form" model="ir.ui.view"> |
||||
|
<field name="name">event_phone.event.form</field> |
||||
|
<field name="model">event.event</field> |
||||
|
<field name="inherit_id" ref="event.view_event_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='registration_ids']/form//field[@name='phone']" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,2 @@ |
|||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
||||
|
callerid_event_registration_read,Read access on event.registration,event.model_event_registration,base_phone.group_callerid,1,0,0,0 |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# HR Phone module for Odoo/OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import hr_phone |
@ -0,0 +1,49 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# HR Phone module for OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
|
||||
|
{ |
||||
|
'name': 'HR Phone', |
||||
|
'version': '0.1', |
||||
|
'category': 'Phone', |
||||
|
'license': 'AGPL-3', |
||||
|
'summary': 'Validate phone numbers in HR', |
||||
|
'description': """ |
||||
|
HR Phone |
||||
|
======== |
||||
|
|
||||
|
This module validate phone numbers in the HR 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. |
||||
|
|
||||
|
This module is independant from the Asterisk connector. |
||||
|
|
||||
|
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module. |
||||
|
""", |
||||
|
'author': 'Akretion', |
||||
|
'website': 'http://www.akretion.com/', |
||||
|
'depends': ['base_phone', 'hr'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'hr_view.xml', |
||||
|
], |
||||
|
'images': [], |
||||
|
'installable': True, |
||||
|
'active': False, |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# HR phone module for Odoo/OpenERP |
||||
|
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com) |
||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp.osv import orm |
||||
|
|
||||
|
|
||||
|
class hr_employee(orm.Model): |
||||
|
_name = 'hr.employee' |
||||
|
_inherit = ['hr.employee', 'phone.common'] |
||||
|
|
||||
|
def create(self, cr, uid, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(hr_employee, self).create( |
||||
|
cr, uid, vals_reformated, context=context) |
||||
|
|
||||
|
def write(self, cr, uid, ids, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(hr_employee, self).write( |
||||
|
cr, uid, ids, vals_reformated, context=context) |
||||
|
|
||||
|
|
||||
|
class phone_common(orm.AbstractModel): |
||||
|
_inherit = 'phone.common' |
||||
|
|
||||
|
def _get_phone_fields(self, cr, uid, context=None): |
||||
|
res = super(phone_common, self)._get_phone_fields( |
||||
|
cr, uid, context=context) |
||||
|
res['hr.employee'] = { |
||||
|
'phonefields': ['work_phone', 'mobile_phone'], |
||||
|
'get_name_sequence': 30, |
||||
|
} |
||||
|
return res |
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_employee_form" model="ir.ui.view"> |
||||
|
<field name="name">hr_phone.hr_employee.form</field> |
||||
|
<field name="model">hr.employee</field> |
||||
|
<field name="inherit_id" ref="hr.view_employee_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="work_phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
<field name="mobile_phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,2 @@ |
|||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
||||
|
callerid_hr_employee_read,Read access on hr.employee,hr.model_hr_employee,base_phone.group_callerid,1,0,0,0 |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# HR Recruitment Phone module for Odoo/OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import hr_recruitment_phone |
@ -0,0 +1,49 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# HR Recruitment Phone module for OpenERP |
||||
|
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
|
||||
|
{ |
||||
|
'name': 'HR Recruitment Phone', |
||||
|
'version': '0.1', |
||||
|
'category': 'Phone', |
||||
|
'license': 'AGPL-3', |
||||
|
'summary': 'Validate phone numbers in HR Recruitment', |
||||
|
'description': """ |
||||
|
HR Recruitment Phone |
||||
|
==================== |
||||
|
|
||||
|
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. |
||||
|
|
||||
|
This module is independant from the Asterisk connector. |
||||
|
|
||||
|
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module. |
||||
|
""", |
||||
|
'author': 'Akretion', |
||||
|
'website': 'http://www.akretion.com/', |
||||
|
'depends': ['base_phone', 'hr_recruitment'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'hr_recruitment_view.xml', |
||||
|
], |
||||
|
'images': [], |
||||
|
'installable': True, |
||||
|
'active': False, |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# HR Recruitment phone module for Odoo/OpenERP |
||||
|
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com) |
||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp.osv import orm |
||||
|
|
||||
|
|
||||
|
class hr_applicant(orm.Model): |
||||
|
_name = 'hr.applicant' |
||||
|
_inherit = ['hr.applicant', 'phone.common'] |
||||
|
|
||||
|
def create(self, cr, uid, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(hr_applicant, self).create( |
||||
|
cr, uid, vals_reformated, context=context) |
||||
|
|
||||
|
def write(self, cr, uid, ids, vals, context=None): |
||||
|
vals_reformated = self._generic_reformat_phonenumbers( |
||||
|
cr, uid, vals, context=context) |
||||
|
return super(hr_applicant, self).write( |
||||
|
cr, uid, ids, vals_reformated, context=context) |
||||
|
|
||||
|
|
||||
|
class phone_common(orm.AbstractModel): |
||||
|
_inherit = 'phone.common' |
||||
|
|
||||
|
def _get_phone_fields(self, cr, uid, context=None): |
||||
|
res = super(phone_common, self)._get_phone_fields( |
||||
|
cr, uid, context=context) |
||||
|
res['hr.applicant'] = { |
||||
|
'phonefields': ['partner_phone', 'partner_mobile'], |
||||
|
'get_name_sequence': 50, |
||||
|
} |
||||
|
return res |
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="crm_case_form_view_job" model="ir.ui.view"> |
||||
|
<field name="name">hr_recruitment_phone.hr_applicant.form</field> |
||||
|
<field name="model">hr.applicant</field> |
||||
|
<field name="inherit_id" ref="hr_recruitment.crm_case_form_view_job"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="partner_phone" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
<field name="partner_mobile" position="attributes"> |
||||
|
<attribute name="widget">phone</attribute> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,2 @@ |
|||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
||||
|
callerid_hr_applicant_read,Read access on hr.applicant,hr_recruitment.model_hr_applicant,base_phone.group_callerid,1,0,0,0 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue