Browse Source

Import phonenumbers protected by try/except

pull/105/head
Alexis de Lattre 8 years ago
parent
commit
53598a0571
  1. 3
      base_phone/base_phone.py
  2. 3
      base_phone/report_sxw_format.py
  3. 3
      base_phone/wizard/number_not_found.py
  4. 3
      crm_phone/wizard/create_crm_phonecall.py

3
base_phone/base_phone.py

@ -24,7 +24,10 @@ from openerp.tools.safe_eval import safe_eval
from openerp.exceptions import Warning
import logging
# Lib for phone number reformating -> pip install phonenumbers
try:
import phonenumbers
except ImportError:
logger.warning('Cannot import phonenumbers')
_logger = logging.getLogger(__name__)

3
base_phone/report_sxw_format.py

@ -21,7 +21,10 @@
from openerp.osv import orm
from openerp.report import report_sxw
try:
import phonenumbers
except ImportError:
logger.warning('Cannot import phonenumbers')
class base_phone_installed(orm.AbstractModel):

3
base_phone/wizard/number_not_found.py

@ -22,7 +22,10 @@
from openerp.osv import orm, fields
from openerp.tools.translate import _
import logging
try:
import phonenumbers
except ImportError:
logger.warning('Cannot import phonenumbers')
_logger = logging.getLogger(__name__)

3
crm_phone/wizard/create_crm_phonecall.py

@ -21,7 +21,10 @@
##############################################################################
from openerp import models, api, _
try:
import phonenumbers
except ImportError:
logger.warning('Cannot import phonenumbers')
class wizard_create_crm_phonecall(models.TransientModel):

Loading…
Cancel
Save