From 9c86c33ad05a2ea38122f9046d094973ef596faa Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 28 Oct 2016 15:35:46 +0200 Subject: [PATCH] try/except on import phonenumbers lib --- crm_phone/__manifest__.py | 1 + crm_phone/wizard/create_crm_phonecall.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crm_phone/__manifest__.py b/crm_phone/__manifest__.py index a0e9bdc..65a6053 100644 --- a/crm_phone/__manifest__.py +++ b/crm_phone/__manifest__.py @@ -24,6 +24,7 @@ for any help or question about this module. 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'http://www.akretion.com/', 'depends': ['base_phone', 'crm'], + 'external_dependencies': {'python': ['phonenumbers']}, 'conflicts': ['crm_voip'], 'data': [ 'security/phonecall_security.xml', diff --git a/crm_phone/wizard/create_crm_phonecall.py b/crm_phone/wizard/create_crm_phonecall.py index 98569da..7b6e912 100644 --- a/crm_phone/wizard/create_crm_phonecall.py +++ b/crm_phone/wizard/create_crm_phonecall.py @@ -3,7 +3,13 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, api, _ -import phonenumbers +import logging +logger = logging.getLogger(__name__) + +try: + import phonenumbers +except ImportError: + logger.debug('Cannot import phonenumbers lib.') class WizardCreateCrmPhonecall(models.TransientModel):