Browse Source
Port to v12 base_phone, asterisk_click2dial, crm_phone, hr_phone, event_phone and hr_recruitment_phone
pull/177/head
Port to v12 base_phone, asterisk_click2dial, crm_phone, hr_phone, event_phone and hr_recruitment_phone
pull/177/head
62 changed files with 673 additions and 585 deletions
-
12asterisk_click2dial/__manifest__.py
-
9asterisk_click2dial/controller.py
-
6asterisk_click2dial/demo/asterisk_click2dial_demo.xml
-
58asterisk_click2dial/models/asterisk_server.py
-
18asterisk_click2dial/models/phone_common.py
-
11asterisk_click2dial/models/res_users.py
-
18asterisk_click2dial/security/asterisk_security.xml
-
26asterisk_click2dial/static/src/css/asterisk_click2dial.css
-
25asterisk_click2dial/static/src/js/asterisk_click2dial.js
-
14asterisk_click2dial/static/src/scss/asterisk.scss
-
13asterisk_click2dial/static/src/xml/asterisk_click2dial.xml
-
6asterisk_click2dial/views/asterisk_server.xml
-
4asterisk_click2dial/views/res_users.xml
-
24asterisk_click2dial/views/web_asterisk_click2dial.xml
-
17asterisk_click2dial/web_asterisk_click2dial.xml
-
3base_phone/__init__.py
-
34base_phone/__manifest__.py
-
22base_phone/controllers/main.py
-
5base_phone/models/__init__.py
-
65base_phone/models/phone_common.py
-
18base_phone/models/phone_validation_mixin.py
-
8base_phone/models/res_company.py
-
4base_phone/models/res_config_settings.py
-
19base_phone/models/res_partner.py
-
103base_phone/static/src/js/phone_widget.js
-
28base_phone/static/src/xml/phone.xml
-
13base_phone/tests/test_phone.py
-
27base_phone/views/base_config_settings.xml
-
30base_phone/views/res_config_settings.xml
-
13base_phone/views/res_partner_view.xml
-
15base_phone/views/res_users_view.xml
-
3base_phone/views/web_phone.xml
-
18base_phone/wizard/number_not_found.py
-
13base_phone/wizard/number_not_found_view.xml
-
19base_phone/wizard/reformat_all_phonenumbers.py
-
17base_phone/wizard/reformat_all_phonenumbers_view.xml
-
2base_sms_client/__manifest__.py
-
7crm_phone/__manifest__.py
-
11crm_phone/demo/crm_phonecall.xml
-
30crm_phone/models/crm_lead.py
-
36crm_phone/models/crm_phonecall.py
-
5crm_phone/models/phone_common.py
-
23crm_phone/models/res_partner.py
-
3crm_phone/models/res_users.py
-
27crm_phone/tests/test_crm_phone.py
-
17crm_phone/view/crm_lead.xml
-
30crm_phone/view/crm_phonecall.xml
-
3crm_phone/view/res_partner.xml
-
3crm_phone/view/res_users.xml
-
19crm_phone/wizard/create_crm_phonecall.py
-
11crm_phone/wizard/create_crm_phonecall_view.xml
-
86crm_phone/wizard/number_not_found.py
-
18crm_phone/wizard/number_not_found_view.xml
-
10event_phone/__manifest__.py
-
15event_phone/models/event_registration.py
-
23event_phone/views/hr_registration.xml
-
5hr_phone/__manifest__.py
-
21hr_phone/models/hr_employee.py
-
9hr_recruitment_phone/__manifest__.py
-
22hr_recruitment_phone/models/hr_applicant.py
-
26hr_recruitment_phone/views/hr_applicant.xml
-
2ovh_sms_client/__manifest__.py
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright 2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
--> |
||||
|
|
||||
|
|
||||
|
<odoo noupdate="1"> |
||||
|
|
||||
|
|
||||
|
<record id="asterisk_server_rule" model="ir.rule"> |
||||
|
<field name="name">Asterisk server multi-company</field> |
||||
|
<field name="model_id" ref="model_asterisk_server"/> |
||||
|
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
</odoo> |
@ -1,26 +0,0 @@ |
|||||
/* |
|
||||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
||||
*/ |
|
||||
|
|
||||
.openerp .oe_topbar_item.oe_topbar_open_caller{ |
|
||||
padding: 0px; |
|
||||
width: 32px; |
|
||||
height: 32px; |
|
||||
} |
|
||||
|
|
||||
.openerp .oe_topbar_item.oe_topbar_open_caller button{ |
|
||||
position: relative; |
|
||||
top: -3px; |
|
||||
box-sizing: border-box; |
|
||||
border: none; |
|
||||
box-shadow: none; |
|
||||
color: white; |
|
||||
background: none; |
|
||||
text-shadow: 0px 1px 2px black; |
|
||||
width: 32px; |
|
||||
height: 32px; |
|
||||
padding: 0px; |
|
||||
margin: 0px |
|
||||
border-radius: 0px; |
|
||||
} |
|
@ -0,0 +1,14 @@ |
|||||
|
/* |
||||
|
Copyright 2016-2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
*/ |
||||
|
|
||||
|
.o_asterisk_systray_item { |
||||
|
> a { |
||||
|
opacity: 1; |
||||
|
> i { |
||||
|
font-size: larger; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
@ -1,24 +1,27 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
<!-- |
||||
© 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
|
Copyright 2014-2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
--> |
--> |
||||
|
|
||||
<template> |
<template> |
||||
|
|
||||
<!-- Add phone button in top right menu for "Open Caller" --> |
<!-- Add phone button in top right menu for "Open Caller" --> |
||||
<t t-name="asterisk_click2dial.OpenCaller"> |
|
||||
<li class="oe_topbar_item oe_topbar_open_caller" |
|
||||
title="Open Caller"> |
|
||||
<a id="asterisk-open-caller" href="#" class="fa fa-phone"/> |
|
||||
|
<t t-name="asterisk_click2dial.systray.OpenCaller"> |
||||
|
<li class="o_mail_systray_item"> |
||||
|
<a id="asterisk-open-caller" href="#" title="Open Caller" role="button"> |
||||
|
<i class="fa fa-phone" role="img" aria-label="Open Caller"/> |
||||
|
</a> |
||||
</li> |
</li> |
||||
</t> |
</t> |
||||
|
|
||||
<!-- Add Dial button in phone widget for click2dial feature --> |
<!-- Add Dial button in phone widget for click2dial feature --> |
||||
|
<!-- |
||||
<t t-extend="FieldPhone"> |
<t t-extend="FieldPhone"> |
||||
<t t-jquery="a.o_form_uri" t-operation="after"> |
<t t-jquery="a.o_form_uri" t-operation="after"> |
||||
<a t-if="widget.clickable" id="click2dial" href="#" class="oe_bold"/> |
<a t-if="widget.clickable" id="click2dial" href="#" class="oe_bold"/> |
||||
</t> |
</t> |
||||
</t> |
</t> |
||||
|
--> |
||||
|
|
||||
</template> |
</template> |
@ -0,0 +1,24 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright 2014-2018 Akretion France |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
--> |
||||
|
|
||||
|
<odoo> |
||||
|
|
||||
|
<template id="_assets_primary_variables" name="asterisk_click2dial assets" |
||||
|
inherit_id="web._assets_primary_variables"> |
||||
|
<xpath expr="//link[last()]" position="after"> |
||||
|
<link rel="stylesheet" type="text/scss" href="/asterisk_click2dial/static/src/scss/asterisk.scss"/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<template id="assets_backend" name="mail assets" inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<script type="text/javascript" |
||||
|
src="/asterisk_click2dial/static/src/js/asterisk_click2dial.js"></script> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
</odoo> |
@ -1,17 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<!-- |
|
||||
© 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
||||
--> |
|
||||
|
|
||||
<odoo> |
|
||||
|
|
||||
<template id="assets_backend" name="asterisk_click2dial assets" |
|
||||
inherit_id="web.assets_backend"> |
|
||||
<xpath expr="." position="inside"> |
|
||||
<script type="text/javascript" |
|
||||
src="/asterisk_click2dial/static/src/js/asterisk_click2dial.js"></script> |
|
||||
</xpath> |
|
||||
</template> |
|
||||
|
|
||||
</odoo> |
|
@ -1,6 +1,5 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
|
|
||||
from . import fields |
|
||||
from . import controllers |
|
||||
from . import models |
from . import models |
||||
from . import wizard |
from . import wizard |
||||
|
from . import controllers |
@ -1,46 +1,28 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################## |
|
||||
# |
|
||||
# Base Phone module for Odoo |
|
||||
# Copyright (C) 2014-2015 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/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
|
# Copyright 2014-2018 Akretion France |
||||
|
# @author: Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
{ |
{ |
||||
'name': 'Base Phone', |
'name': 'Base Phone', |
||||
'version': '10.0.0.1.0', |
|
||||
|
'version': '12.0.1.0.0', |
||||
'category': 'Phone', |
'category': 'Phone', |
||||
'license': 'AGPL-3', |
'license': 'AGPL-3', |
||||
'summary': 'Validate phone numbers', |
'summary': 'Validate phone numbers', |
||||
'author': "Akretion,Odoo Community Association (OCA)", |
'author': "Akretion,Odoo Community Association (OCA)", |
||||
'website': 'http://www.akretion.com/', |
'website': 'http://www.akretion.com/', |
||||
'depends': ['base_setup', 'web'], |
|
||||
|
'depends': ['phone_validation', 'base_setup'], |
||||
'external_dependencies': {'python': ['phonenumbers']}, |
'external_dependencies': {'python': ['phonenumbers']}, |
||||
'data': [ |
'data': [ |
||||
'security/phone_security.xml', |
'security/phone_security.xml', |
||||
'security/ir.model.access.csv', |
'security/ir.model.access.csv', |
||||
'views/res_partner_view.xml', |
|
||||
'views/base_config_settings.xml', |
|
||||
|
'views/res_config_settings.xml', |
||||
'views/res_users_view.xml', |
'views/res_users_view.xml', |
||||
'wizard/reformat_all_phonenumbers_view.xml', |
'wizard/reformat_all_phonenumbers_view.xml', |
||||
'wizard/number_not_found_view.xml', |
'wizard/number_not_found_view.xml', |
||||
'web_phone.xml', |
|
||||
|
'views/web_phone.xml', |
||||
], |
], |
||||
'qweb': ['static/src/xml/*.xml'], |
|
||||
|
'qweb': ['static/src/xml/phone.xml'], |
||||
'images': [], |
'images': [], |
||||
'installable': True, |
'installable': True, |
||||
} |
} |
@ -1,8 +1,7 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
|
|
||||
from . import base |
|
||||
|
from . import phone_validation_mixin |
||||
from . import res_company |
from . import res_company |
||||
from . import base_config_settings |
|
||||
|
from . import res_config_settings |
||||
from . import res_partner |
from . import res_partner |
||||
from . import phone_common |
from . import phone_common |
||||
from . import ir_fields_converter |
|
@ -0,0 +1,18 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Copyright 2018 Akretion France |
||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
|
||||
|
from odoo import models |
||||
|
|
||||
|
|
||||
|
class PhoneValidationMixin(models.AbstractModel): |
||||
|
_inherit = 'phone.validation.mixin' |
||||
|
|
||||
|
def _phone_get_country(self): |
||||
|
if 'country_id' in self and self.country_id: |
||||
|
return self.country_id |
||||
|
if 'partner_id' in self and self.partner_id and self.partner_id.country_id: |
||||
|
return self.partner_id.country_id |
||||
|
return self.env.user.company_id.country_id |
@ -1,28 +1,16 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- |
<!-- |
||||
Base phone module for Odoo |
|
||||
Copyright (C) 2013-2015 Alexis de Lattre <alexis@via.ecp.fr> |
|
||||
The licence is in the file __openerp__.py |
|
||||
|
Copyright (C) 2013-2018 Akretion France |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
--> |
--> |
||||
|
|
||||
<templates id="template" xml:space="preserve"> |
|
||||
|
<templates> |
||||
|
|
||||
<t t-name="FieldFax" t-extend="FieldEmail"> |
|
||||
<t t-jquery="span" t-operation="replace"> |
|
||||
<t t-if="widget.get('effective_readonly')"> |
|
||||
<a t-if="widget.clickable" class="o_form_uri o_text_overflow" href="#" target="_blank"/> |
|
||||
<span t-if="!widget.clickable" class="o_text_overflow"/> |
|
||||
</t> |
|
||||
</t> |
|
||||
</t> |
|
||||
|
|
||||
<t t-name="FieldPhone" t-extend="FieldFax"> |
|
||||
<t t-jquery="span" t-operation="replace"> |
|
||||
<t t-if="widget.get('effective_readonly')"> |
|
||||
<a t-if="widget.clickable" class="o_form_uri o_text_overflow" href="#" target="_blank"/> |
|
||||
<span t-if="!widget.clickable" class="o_text_overflow"/> |
|
||||
</t> |
|
||||
</t> |
|
||||
|
<t t-name="base_phone.dial"> |
||||
|
<span class="float-right"> |
||||
|
<a href="#" target="_blank" class="fa fa-lg fa-phone" aria-label="Dial" title="Dial"/> |
||||
|
</span> |
||||
</t> |
</t> |
||||
|
|
||||
</templates> |
</templates> |
@ -1,27 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<!-- |
|
||||
© 2014-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
||||
--> |
|
||||
|
|
||||
<odoo> |
|
||||
|
|
||||
|
|
||||
<record id="view_general_configuration" model="ir.ui.view"> |
|
||||
<field name="name">base_phone.base.config.settings.form</field> |
|
||||
<field name="model">base.config.settings</field> |
|
||||
<field name="inherit_id" ref="base_setup.view_general_configuration" /> |
|
||||
<field name="arch" type="xml"> |
|
||||
<group name="report" position="before"> |
|
||||
<group name="phone" string="Phone"> |
|
||||
<label for="number_of_digits_to_match_from_end"/> |
|
||||
<div> |
|
||||
<field name="number_of_digits_to_match_from_end" class="oe_inline"/> |
|
||||
</div> |
|
||||
</group> |
|
||||
</group> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
|
|
||||
</odoo> |
|
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright 2014-2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
--> |
||||
|
|
||||
|
<odoo> |
||||
|
|
||||
|
|
||||
|
<record id="res_config_settings_view_form" model="ir.ui.view"> |
||||
|
<field name="name">base_phone.base.config.settings.form</field> |
||||
|
<field name="model">res.config.settings</field> |
||||
|
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" /> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//div[hasclass('settings')]" position="inside"> |
||||
|
<div id="phone" string="Phone"> |
||||
|
<h2>Phone</h2> |
||||
|
<div class="row mt16 o_settings_container"> |
||||
|
<label for="number_of_digits_to_match_from_end"/> |
||||
|
<div> |
||||
|
<field name="number_of_digits_to_match_from_end" class="oe_inline"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
</odoo> |
@ -1,13 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<!-- |
|
||||
© 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
||||
--> |
|
||||
|
|
||||
<odoo> |
|
||||
|
|
||||
<record id="base.action_partner_form" model="ir.actions.act_window"> |
|
||||
<field name="context">{'search_default_customer': 1, 'raise_if_phone_parse_fails': True}</field> |
|
||||
</record> |
|
||||
|
|
||||
</odoo> |
|
@ -1,6 +1,7 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- |
<!-- |
||||
© 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
|
Copyright 2014-2018 Akretion France |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
--> |
--> |
||||
|
|
@ -1,13 +1,18 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2012-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
|
# Copyright 2012-2018 Akretion France |
||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
from odoo import models |
|
||||
from odoo.addons.base_phone.fields import Phone |
|
||||
|
from odoo import api, models |
||||
|
|
||||
|
|
||||
class EventRegistration(models.Model): |
class EventRegistration(models.Model): |
||||
_inherit = 'event.registration' |
|
||||
|
_name = 'event.registration' |
||||
|
_inherit = ['event.registration', 'phone.validation.mixin'] |
||||
_phone_name_sequence = 100 |
_phone_name_sequence = 100 |
||||
|
_phone_name_fields = ['phone'] |
||||
|
|
||||
phone = Phone(partner_field='partner_id') |
|
||||
|
@api.onchange('phone') |
||||
|
def phone_change(self): |
||||
|
if self.phone: |
||||
|
self.phone = self.phone_format(self.phone) |
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright 2018 Akretion France |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
--> |
||||
|
|
||||
|
<odoo> |
||||
|
|
||||
|
|
||||
|
<record id="view_event_registration_form" model="ir.ui.view"> |
||||
|
<field name="name">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> |
||||
|
|
||||
|
|
||||
|
</odoo> |
@ -1,14 +1,23 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2012-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|
||||
|
# Copyright 2012-2018 Akretion France |
||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
from odoo import models |
|
||||
from odoo.addons.base_phone.fields import Phone |
|
||||
|
from odoo import api, models |
||||
|
|
||||
|
|
||||
class HrEmployee(models.Model): |
class HrEmployee(models.Model): |
||||
_inherit = 'hr.employee' |
|
||||
|
_name = 'hr.employee' |
||||
|
_inherit = ['hr.employee', 'phone.validation.mixin'] |
||||
_phone_name_sequence = 30 |
_phone_name_sequence = 30 |
||||
|
_phone_name_fields = ['work_phone', 'mobile_phone'] |
||||
|
|
||||
work_phone = Phone(country_field='country_id') |
|
||||
mobile_phone = Phone(country_field='country_id') |
|
||||
|
@api.onchange('work_phone') |
||||
|
def work_phone_change(self): |
||||
|
if self.work_phone: |
||||
|
self.work_phone = self.phone_format(self.work_phone) |
||||
|
|
||||
|
@api.onchange('mobile_phone') |
||||
|
def mobile_phone_change(self): |
||||
|
if self.mobile_phone: |
||||
|
self.mobile_phone = self.phone_format(self.mobile_phone) |
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright 2018 Akretion France |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
--> |
||||
|
|
||||
|
<odoo> |
||||
|
|
||||
|
|
||||
|
<record id="crm_case_form_view_job" model="ir.ui.view"> |
||||
|
<field name="name">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> |
||||
|
|
||||
|
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue