Browse Source
Merge pull request #190 from akretion/12-up-port
Merge pull request #190 from akretion/12-up-port
[12.0] Forward port dial button refactor from v11 to v12pull/191/head
Alexis de Lattre
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 281 additions and 267 deletions
-
4asterisk_click2dial/__manifest__.py
-
2asterisk_click2dial/demo/asterisk_click2dial_demo.xml
-
28asterisk_click2dial/static/src/js/asterisk_click2dial.js
-
10asterisk_click2dial/views/asterisk_server.xml
-
2base_phone/common.py
-
2base_phone/fields.py
-
10base_phone/models/phone_common.py
-
5base_phone/models/phone_validation_mixin.py
-
3base_phone/models/res_config_settings.py
-
20base_phone/models/res_partner.py
-
156base_phone/static/src/js/phone_widget.js
-
3base_phone/tests/__init__.py
-
69base_phone/tests/test_phone.py
-
20base_phone/views/res_config_settings.xml
-
5base_phone/wizard/reformat_all_phonenumbers.py
-
2base_phone_popup/__init__.py
-
38base_phone_popup/__manifest__.py
-
4base_phone_popup/models/__init__.py
-
46base_phone_popup/models/phone_common.py
-
13base_phone_popup/models/res_users.py
-
1base_phone_popup/readme/CONTRIBUTORS.rst
-
3base_phone_popup/readme/DESCRIPTION.rst
-
1base_phone_popup/readme/USAGE.rst
-
7base_phone_popup/views/res_users.xml
-
82crm_phone/tests/test_crm_phone.py
-
5crm_phone/wizard/create_crm_phonecall.py
-
4hr_recruitment_phone/__manifest__.py
-
3oca_dependencies.txt
@ -1,3 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from . import test_phone |
@ -1,69 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2016-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.tests.common import TransactionCase |
|||
|
|||
|
|||
class TestPhone(TransactionCase): |
|||
|
|||
def test_phone(self): |
|||
company = self.env.ref('base.main_company') |
|||
fr_country_id = self.env.ref('base.fr').id |
|||
company.country_id = fr_country_id |
|||
rpo = self.env['res.partner'] |
|||
# Create an existing partner without country |
|||
partner1 = rpo.create({ |
|||
'name': u'Pierre Paillet', |
|||
'phone': '04-72-08-87-32', |
|||
'mobile': '06.42.77.42.66', |
|||
'fax': '(0) 1 45 42 12 42', |
|||
}) |
|||
self.assertEquals(partner1.phone, u'+33 4 72 08 87 32') |
|||
self.assertEquals(partner1.mobile, u'+33 6 42 77 42 66') |
|||
self.assertEquals(partner1.fax, u'+33 1 45 42 12 42') |
|||
# Create a partner with country |
|||
self.env.ref('base.res_partner_12').country_id =\ |
|||
self.env.ref('base.ch').id |
|||
partner2 = rpo.create({ |
|||
'name': u'Joël Grand-Guillaume', |
|||
'parent_id': self.env.ref('base.res_partner_12').id, |
|||
'phone': '(0) 21 619 10 10', |
|||
'mobile': '(0) 79 606 42 42', |
|||
}) |
|||
self.assertEquals(partner2.country_id, self.env.ref('base.ch')) |
|||
self.assertEquals(partner2.phone, u'+41 21 619 10 10') |
|||
self.assertEquals(partner2.mobile, u'+41 79 606 42 42') |
|||
# Write on an existing partner |
|||
agrolait = self.env.ref('base.res_partner_2') |
|||
self.assertEquals(agrolait.country_id, self.env.ref('base.be')) |
|||
agrolait.write({'phone': '(0) 2 391 43 74'}) |
|||
self.assertEquals(agrolait.phone, u'+32 2 391 43 74') |
|||
# Write on an existing partner with country at the same time |
|||
agrolait.write({ |
|||
'fax': '04 72 89 32 43', |
|||
'country_id': fr_country_id, |
|||
}) |
|||
self.assertEquals(agrolait.fax, u'+33 4 72 89 32 43') |
|||
# Write an invalid phone number |
|||
partner2.fax = '42' |
|||
self.assertEquals(partner2.fax, u'42') |
|||
# Test get_name_from_phone_number |
|||
pco = self.env['phone.common'] |
|||
name = pco.get_name_from_phone_number('0642774266') |
|||
self.assertEquals(name, 'Pierre Paillet') |
|||
name2 = pco.get_name_from_phone_number('0041216191010') |
|||
self.assertEquals(name2, u'Joël Grand-Guillaume (Camptocamp)') |
|||
# Test against the POS bug |
|||
# https://github.com/OCA/connector-telephony/issues/113 |
|||
# When we edit/create a partner from the POS, |
|||
# the country_id key in create(vals) is given as a string ! |
|||
partnerpos = rpo.create({ |
|||
'name': u'POS customer', |
|||
'phone': '04-72-08-87-42', |
|||
'country_id': str(fr_country_id), |
|||
}) |
|||
self.assertEquals(partnerpos.phone, u'+33 4 72 08 87 42') |
|||
self.assertEquals(partnerpos.country_id.id, fr_country_id) |
@ -1,3 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from . import popup |
|||
from . import models |
@ -1,43 +1,15 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
|||
# Copyright 2014-2019 Akretion France (http://www.akretion.com/) |
|||
# @author: Alexis de Lattre <alexis.delattre@akretion.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
|
|||
{ |
|||
'name': 'Base Phone Pop-up', |
|||
'version': '9.0.1.0.0', |
|||
'version': '12.0.1.0.0', |
|||
'category': 'Phone', |
|||
'license': 'AGPL-3', |
|||
'summary': 'Pop-up the related form view to the user on incoming calls', |
|||
'description': """ |
|||
Base Phone Pop-up |
|||
================= |
|||
|
|||
When the user receives a phone call, OpenERP can automatically open the |
|||
corresponding partner/lead/employee/... in a pop-up without any action from the |
|||
user. |
|||
|
|||
The module *web_action_request* can be downloaded with Mercurial: |
|||
|
|||
hg clone http://bitbucket.org/anybox/web_action_request |
|||
|
|||
It depends on 2 other modules, *web_longpolling* and *web_socketio*, that can |
|||
be downloaded with this command: |
|||
|
|||
hg clone http://bitbucket.org/anybox/web_socketio |
|||
|
|||
You will find some hints in this documentation : |
|||
https://bitbucket.org/anybox/web_action_request |
|||
|
|||
Warning : proxying WebSockets is only supported since Nginx 1.3.13 ; the |
|||
feature provided by this module won't work with older versions of Nginx. |
|||
|
|||
TODO : document this new feature on the Akretion Web site : |
|||
http://www.akretion.com/products-and-services/openerp-asterisk-voip-connector |
|||
""", |
|||
'author': "Akretion,Odoo Community Association (OCA)", |
|||
'website': 'http://www.akretion.com/', |
|||
'depends': ['base_phone', 'web_action_request'], |
|||
'data': ['res_users_view.xml'], |
|||
'installable': False, |
|||
'depends': ['base_phone', 'web_notify'], |
|||
'installable': True, |
|||
} |
@ -0,0 +1,4 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from . import phone_common |
|||
#from . import res_users |
@ -0,0 +1,13 @@ |
|||
# -*- coding: 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). |
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResUsers(models.Model): |
|||
_inherit = 'res.users' |
|||
|
|||
context_incall_popup = fields.Boolean( |
|||
string='Pop-up on Incoming Calls', default=True) |
@ -0,0 +1 @@ |
|||
* Alexis de Lattre <alexis.delattre@akretion.com> |
@ -0,0 +1,3 @@ |
|||
When the user receives a phone call, Odoo will display a notification |
|||
at the top-right of the screen that contains a link to the corresponding |
|||
partner/lead/employee/... or a link to the *Number not found* wizard. |
@ -0,0 +1 @@ |
|||
To deploy this feature with an Asterisk-based IPBX, please read this `document <https://akretion.com/en/open-source-contributions/odoo-asterisk-voip-connector>`_. |
@ -1 +1,2 @@ |
|||
server-tools |
|||
server-tools |
|||
web |
Write
Preview
Loading…
Cancel
Save
Reference in new issue