Browse Source

try/except on import phonenumbers lib

pull/109/head
Alexis de Lattre 8 years ago
parent
commit
9c86c33ad0
  1. 1
      crm_phone/__manifest__.py
  2. 6
      crm_phone/wizard/create_crm_phonecall.py

1
crm_phone/__manifest__.py

@ -24,6 +24,7 @@ for any help or question about this module.
'author': "Akretion,Odoo Community Association (OCA)", 'author': "Akretion,Odoo Community Association (OCA)",
'website': 'http://www.akretion.com/', 'website': 'http://www.akretion.com/',
'depends': ['base_phone', 'crm'], 'depends': ['base_phone', 'crm'],
'external_dependencies': {'python': ['phonenumbers']},
'conflicts': ['crm_voip'], 'conflicts': ['crm_voip'],
'data': [ 'data': [
'security/phonecall_security.xml', 'security/phonecall_security.xml',

6
crm_phone/wizard/create_crm_phonecall.py

@ -3,7 +3,13 @@
# 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, api, _ from odoo import models, api, _
import logging
logger = logging.getLogger(__name__)
try:
import phonenumbers import phonenumbers
except ImportError:
logger.debug('Cannot import phonenumbers lib.')
class WizardCreateCrmPhonecall(models.TransientModel): class WizardCreateCrmPhonecall(models.TransientModel):

Loading…
Cancel
Save