Browse Source
Merge pull request #47 from akretion/8.0-add-ovh-connector
Merge pull request #47 from akretion/8.0-add-ovh-connector
New module ovh_telephony_connector and related code-reorg in other modulespull/51/head
Alexis de Lattre
10 years ago
25 changed files with 279 additions and 383 deletions
-
2.travis.yml
-
15README.md
-
7asterisk_click2dial/asterisk_click2dial.py
-
2asterisk_click2dial_crm/__init__.py
-
30asterisk_click2dial_crm/__openerp__.py
-
45asterisk_click2dial_crm/asterisk_click2dial_crm.py
-
88asterisk_click2dial_crm/i18n/asterisk_click2dial_crm.pot
-
44asterisk_click2dial_crm/i18n/ca.po
-
44asterisk_click2dial_crm/i18n/es.po
-
88asterisk_click2dial_crm/i18n/fr.po
-
23asterisk_click2dial_crm/res_users_view.xml
-
BINasterisk_click2dial_crm/static/description/icon.png
-
4base_phone/base_phone.py
-
4base_phone/controller.py
-
3base_phone/static/src/xml/phone.xml
-
7base_phone/wizard/number_not_found.py
-
3base_phone/wizard/number_not_found_view.xml
-
19crm_phone/crm_phone.py
-
4crm_phone/res_users_view.xml
-
4crm_phone/wizard/number_not_found.py
-
22ovh_telephony_connector/__init__.py
-
39ovh_telephony_connector/__openerp__.py
-
104ovh_telephony_connector/ovh_connector.py
-
42ovh_telephony_connector/res_users_view.xml
-
17ovh_telephony_connector/static/src/xml/ovh_connector.xml
@ -1,45 +0,0 @@ |
|||||
# -*- encoding: utf-8 -*- |
|
||||
############################################################################## |
|
||||
# |
|
||||
# Asterisk click2dial CRM module for 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 import models, api, _ |
|
||||
|
|
||||
|
|
||||
class PhoneCommon(models.AbstractModel): |
|
||||
_inherit = 'phone.common' |
|
||||
|
|
||||
@api.model |
|
||||
def click2dial(self, erp_number): |
|
||||
''' |
|
||||
Inherit the native click2dial function to trigger |
|
||||
a wizard "Create Call in CRM" via the Javascript code |
|
||||
of base_phone |
|
||||
''' |
|
||||
res = super(PhoneCommon, self).click2dial(erp_number) |
|
||||
if ( |
|
||||
self.env.context.get('click2dial_model') in |
|
||||
('res.partner', 'crm.lead') and |
|
||||
self.env.user.context_propose_creation_crm_call): |
|
||||
res.update({ |
|
||||
'action_name': _('Create Call in CRM'), |
|
||||
'action_model': 'wizard.create.crm.phonecall', |
|
||||
}) |
|
||||
return res |
|
@ -1,88 +0,0 @@ |
|||||
# Translation of OpenERP Server. |
|
||||
# This file contains the translation of the following modules: |
|
||||
# * asterisk_click2dial_crm |
|
||||
# |
|
||||
msgid "" |
|
||||
msgstr "" |
|
||||
"Project-Id-Version: OpenERP Server 7.0\n" |
|
||||
"Report-Msgid-Bugs-To: \n" |
|
||||
"POT-Creation-Date: 2014-08-25 22:02+0000\n" |
|
||||
"PO-Revision-Date: 2014-08-25 22:02+0000\n" |
|
||||
"Last-Translator: <>\n" |
|
||||
"Language-Team: \n" |
|
||||
"MIME-Version: 1.0\n" |
|
||||
"Content-Type: text/plain; charset=UTF-8\n" |
|
||||
"Content-Transfer-Encoding: \n" |
|
||||
"Plural-Forms: \n" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "CRM phone call" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.actions.act_window,name:asterisk_click2dial_crm.action_create_crm_phonecall |
|
||||
msgid "Create CRM phonecall" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: code:addons/asterisk_click2dial_crm/asterisk_click2dial_crm.py:46 |
|
||||
#, python-format |
|
||||
msgid "Create Call in CRM" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "Create a phone call in the CRM ?" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_crm_lead |
|
||||
msgid "Lead/Opportunity" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "No" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_wizard_open_calling_partner |
|
||||
msgid "Open calling partner" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_res_partner |
|
||||
msgid "Partner" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: field:res.users,context_propose_creation_crm_call:0 |
|
||||
msgid "Propose to create a call in CRM after a click2dial" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_reformat_all_phonenumbers |
|
||||
msgid "Reformat all phone numbers" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_res_users |
|
||||
msgid "Users" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "Yes" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_phone_common |
|
||||
msgid "phone.common" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_wizard_create_crm_phonecall |
|
||||
msgid "wizard.create.crm.phonecall" |
|
||||
msgstr "" |
|
||||
|
|
@ -1,44 +0,0 @@ |
|||||
# Translation of OpenERP Server. |
|
||||
# This file contains the translation of the following modules: |
|
||||
# * asterisk_click2dial_crm |
|
||||
# |
|
||||
msgid "" |
|
||||
msgstr "" |
|
||||
"Project-Id-Version: OpenERP Server 6.0.2\n" |
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n" |
|
||||
"POT-Creation-Date: 2011-11-09 15:28+0000\n" |
|
||||
"PO-Revision-Date: 2011-11-09 16:30+0100\n" |
|
||||
"Last-Translator: Jesús Martín <jmartin@zikzakmedia.com>\n" |
|
||||
"Language-Team: \n" |
|
||||
"MIME-Version: 1.0\n" |
|
||||
"Content-Type: text/plain; charset=UTF-8\n" |
|
||||
"Content-Transfer-Encoding: 8bit\n" |
|
||||
"Plural-Forms: \n" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_res_partner_address |
|
||||
msgid "Partner Addresses" |
|
||||
msgstr "Adreça de l'empresa" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.module.module,description:asterisk_click2dial_crm.module_meta_information |
|
||||
msgid "" |
|
||||
"\n" |
|
||||
" Create a outbound phone call when the user makes a call phone by clicking\n" |
|
||||
" the click2dial button of the partner address view, and opens it in a new tab.\n" |
|
||||
" " |
|
||||
msgstr "" |
|
||||
"\n" |
|
||||
" Crea una trucada de telèfon sortint quan l'usuari fa una trucada de telèfon\n" |
|
||||
" mitjançant el botó click2dial de la vista d'adreces de l'empresa i l'obre a una\n" |
|
||||
" nova pestanya.\n" |
|
||||
" " |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.module.module,shortdesc:asterisk_click2dial_crm.module_meta_information |
|
||||
msgid "Asterisk Click2dial CRM" |
|
||||
msgstr "Asterisk Click2dial CRM" |
|
||||
|
|
||||
#~ msgid "Reconciliation" |
|
||||
#~ msgstr "Reconciliació" |
|
||||
|
|
@ -1,44 +0,0 @@ |
|||||
# Translation of OpenERP Server. |
|
||||
# This file contains the translation of the following modules: |
|
||||
# * asterisk_click2dial_crm |
|
||||
# |
|
||||
msgid "" |
|
||||
msgstr "" |
|
||||
"Project-Id-Version: OpenERP Server 6.0.2\n" |
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n" |
|
||||
"POT-Creation-Date: 2011-11-09 15:28+0000\n" |
|
||||
"PO-Revision-Date: 2011-11-09 16:32+0100\n" |
|
||||
"Last-Translator: Jesús Martín <jmartin@zikzakmedia.com>\n" |
|
||||
"Language-Team: \n" |
|
||||
"MIME-Version: 1.0\n" |
|
||||
"Content-Type: text/plain; charset=UTF-8\n" |
|
||||
"Content-Transfer-Encoding: 8bit\n" |
|
||||
"Plural-Forms: \n" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_res_partner_address |
|
||||
msgid "Partner Addresses" |
|
||||
msgstr "Dirección de la empresa" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.module.module,description:asterisk_click2dial_crm.module_meta_information |
|
||||
msgid "" |
|
||||
"\n" |
|
||||
" Create a outbound phone call when the user makes a call phone by clicking\n" |
|
||||
" the click2dial button of the partner address view, and opens it in a new tab.\n" |
|
||||
" " |
|
||||
msgstr "" |
|
||||
"\n" |
|
||||
" Crea una llamada de teléfono saliente cuando el usuario hace una llamada de\n" |
|
||||
" teléfono mediante el botón click2dial de la vista de direcciones de la empresa y\n" |
|
||||
" la abre a una nueva pestaña.\n" |
|
||||
" " |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.module.module,shortdesc:asterisk_click2dial_crm.module_meta_information |
|
||||
msgid "Asterisk Click2dial CRM" |
|
||||
msgstr "Asterisk Click2dial CRM" |
|
||||
|
|
||||
#~ msgid "Reconciliation" |
|
||||
#~ msgstr "Reconciliació" |
|
||||
|
|
@ -1,88 +0,0 @@ |
|||||
# Translation of OpenERP Server. |
|
||||
# This file contains the translation of the following modules: |
|
||||
# * asterisk_click2dial_crm |
|
||||
# |
|
||||
msgid "" |
|
||||
msgstr "" |
|
||||
"Project-Id-Version: OpenERP Server 7.0\n" |
|
||||
"Report-Msgid-Bugs-To: \n" |
|
||||
"POT-Creation-Date: 2014-08-25 22:02+0000\n" |
|
||||
"PO-Revision-Date: 2014-08-25 22:02+0000\n" |
|
||||
"Last-Translator: Alexis de Lattre <alexis.delattre@akretion.com>\n" |
|
||||
"Language-Team: \n" |
|
||||
"MIME-Version: 1.0\n" |
|
||||
"Content-Type: text/plain; charset=UTF-8\n" |
|
||||
"Content-Transfer-Encoding: \n" |
|
||||
"Plural-Forms: \n" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "CRM phone call" |
|
||||
msgstr "Appel dans la CRM" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.actions.act_window,name:asterisk_click2dial_crm.action_create_crm_phonecall |
|
||||
msgid "Create CRM phonecall" |
|
||||
msgstr "Créer un appel dans la CRM" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: code:addons/asterisk_click2dial_crm/asterisk_click2dial_crm.py:46 |
|
||||
#, python-format |
|
||||
msgid "Create Call in CRM" |
|
||||
msgstr "Créer Appel dans CRM" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "Create a phone call in the CRM ?" |
|
||||
msgstr "Créer un appel téléphonique dans la CRM ?" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_crm_lead |
|
||||
msgid "Lead/Opportunity" |
|
||||
msgstr "Piste/opportunité" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "No" |
|
||||
msgstr "Non" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_wizard_open_calling_partner |
|
||||
msgid "Open calling partner" |
|
||||
msgstr "Ouvrir le partenaire appelant" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_res_partner |
|
||||
msgid "Partner" |
|
||||
msgstr "Partenaire" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: field:res.users,context_propose_creation_crm_call:0 |
|
||||
msgid "Propose to create a call in CRM after a click2dial" |
|
||||
msgstr "Propose de créer un appel dans la CRM après un click2dial" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_reformat_all_phonenumbers |
|
||||
msgid "Reformat all phone numbers" |
|
||||
msgstr "Reformate tous les numéros de téléphone" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_res_users |
|
||||
msgid "Users" |
|
||||
msgstr "Utilisateurs" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: view:wizard.create.crm.phonecall:0 |
|
||||
msgid "Yes" |
|
||||
msgstr "Oui" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_phone_common |
|
||||
msgid "phone.common" |
|
||||
msgstr "phone.common" |
|
||||
|
|
||||
#. module: asterisk_click2dial_crm |
|
||||
#: model:ir.model,name:asterisk_click2dial_crm.model_wizard_create_crm_phonecall |
|
||||
msgid "wizard.create.crm.phonecall" |
|
||||
msgstr "wizard.create.crm.phonecall" |
|
||||
|
|
@ -1,23 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<!-- |
|
||||
Copyright (C) 2012-2015 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_users_form_simple_modif" model="ir.ui.view"> |
|
||||
<field name="name">asterisk.crm.preferences.option.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="attributes"> |
|
||||
<attribute name="invisible">0</attribute> |
|
||||
</group> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
Before Width: 100 | Height: 100 | Size: 16 KiB |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# OVH Connector module for Odoo |
||||
|
# Copyright (C) 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import ovh_connector |
@ -0,0 +1,39 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# OVH Connector module for Odoo |
||||
|
# Copyright (C) 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
{ |
||||
|
'name': 'OVH Telephony Connector', |
||||
|
'version': '0.1', |
||||
|
'category': 'Phone', |
||||
|
'license': 'AGPL-3', |
||||
|
'summary': 'OVH-Odoo telephony connector (click2call)', |
||||
|
'author': 'Akretion', |
||||
|
'website': 'http://www.akretion.com/', |
||||
|
'depends': ['base_phone'], |
||||
|
'external_dependencies': {'python': ['phonenumbers', 'SOAPpy']}, |
||||
|
'data': [ |
||||
|
'res_users_view.xml', |
||||
|
], |
||||
|
'demo': [], |
||||
|
'qweb': ['static/src/xml/*.xml'], |
||||
|
'application': True, |
||||
|
'installable': True, |
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# OVH connector module for Odoo |
||||
|
# Copyright (C) 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp import models, fields, api, _ |
||||
|
from openerp.exceptions import Warning |
||||
|
import logging |
||||
|
|
||||
|
try: |
||||
|
# -> pip install SOAPpy |
||||
|
from SOAPpy import WSDL |
||||
|
except ImportError: |
||||
|
WSDL = None |
||||
|
|
||||
|
_logger = logging.getLogger(__name__) |
||||
|
|
||||
|
|
||||
|
class ResUsers(models.Model): |
||||
|
_inherit = "res.users" |
||||
|
|
||||
|
ovh_billing_number = fields.Char(string='OVH Billing Number') |
||||
|
ovh_calling_number = fields.Char( |
||||
|
string="OVH Calling Number", help="The phone number that will " |
||||
|
"be presented during a click2dial") |
||||
|
ovh_click2call_login = fields.Char(string='OVH Click2call Login') |
||||
|
ovh_click2call_password = fields.Char( |
||||
|
string="OVH Click2call Password") |
||||
|
|
||||
|
|
||||
|
class PhoneCommon(models.AbstractModel): |
||||
|
_inherit = 'phone.common' |
||||
|
|
||||
|
@api.model |
||||
|
def click2dial(self, erp_number): |
||||
|
res = super(PhoneCommon, self).click2dial(erp_number) |
||||
|
if not erp_number: |
||||
|
raise Warning( |
||||
|
_('Missing phone number')) |
||||
|
|
||||
|
user = self.env.user |
||||
|
if not user.ovh_billing_number: |
||||
|
raise Warning( |
||||
|
_('Missing OVH Billing Number on user %s') % user.name) |
||||
|
|
||||
|
if not user.ovh_calling_number: |
||||
|
raise Warning( |
||||
|
_('Missing OVH Calling Number on user %s') % user.name) |
||||
|
|
||||
|
if not user.ovh_click2call_login: |
||||
|
raise Warning( |
||||
|
_('Missing OVH Click2call Login on user %s') % user.name) |
||||
|
|
||||
|
if not user.ovh_click2call_password: |
||||
|
raise Warning( |
||||
|
_('Missing OVH Click2dial Password on user %s') % user.name) |
||||
|
|
||||
|
soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.63.wsdl') |
||||
|
|
||||
|
called_number = self.convert_to_dial_number(erp_number) |
||||
|
_logger.debug( |
||||
|
'Starting OVH telephonyClick2CallDo request with ' |
||||
|
'login = %s billing number = %s calling number = %s ' |
||||
|
'and called_number = %s' |
||||
|
% (user.ovh_click2call_login, user.ovh_billing_number, |
||||
|
user.ovh_calling_number, called_number)) |
||||
|
|
||||
|
try: |
||||
|
soap.telephonyClick2CallDo( |
||||
|
user.ovh_click2call_login, |
||||
|
user.ovh_click2call_password, |
||||
|
user.ovh_calling_number, |
||||
|
called_number, |
||||
|
user.ovh_billing_number) |
||||
|
_logger.info("OVH telephonyClick2CallDo successfull") |
||||
|
|
||||
|
except Exception, e: |
||||
|
_logger.error( |
||||
|
"Error in the OVH telephonyClick2CallDo request") |
||||
|
_logger.error( |
||||
|
"Here are the details of the error: '%s'" % unicode(e)) |
||||
|
raise Warning( |
||||
|
_("Click to call to OVH failed.\nHere is the error: " |
||||
|
"'%s'") |
||||
|
% unicode(e)) |
||||
|
|
||||
|
res['dialed_number'] = called_number |
||||
|
return res |
@ -0,0 +1,42 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
Copyright (C) 2015 Akretion (www.akretion.com) |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_users_form" model="ir.ui.view"> |
||||
|
<field name="name">ovh_connector.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="after"> |
||||
|
<group name="ovh" string="OVH Parameters"> |
||||
|
<field name="ovh_billing_number"/> |
||||
|
<field name="ovh_calling_number"/> |
||||
|
<field name="ovh_click2call_login"/> |
||||
|
<field name="ovh_click2call_password" password="True"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="view_users_form_simple_modif" model="ir.ui.view"> |
||||
|
<field name="name">ovh_connector.users.preferences.option.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="attributes"> |
||||
|
<attribute name="invisible">0</attribute> |
||||
|
</group> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,17 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- |
||||
|
OVH connector module for Odoo |
||||
|
Copyright (C) 2015 Alexis de Lattre <alexis@via.ecp.fr> |
||||
|
The licence is in the file __openerp__.py |
||||
|
--> |
||||
|
|
||||
|
<template> |
||||
|
|
||||
|
<!-- Add Dial button in phone widget for click2dial feature --> |
||||
|
<t t-extend="FieldPhone"> |
||||
|
<t t-jquery="a.oe_form_uri" t-operation="after"> |
||||
|
<a id="click2dial" href="#" class="oe_bold"/> |
||||
|
</t> |
||||
|
</t> |
||||
|
|
||||
|
</template> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue