Browse Source

Import phonenumbers protected by try/except

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

5
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
import phonenumbers
try:
import phonenumbers
except ImportError:
logger.warning('Cannot import phonenumbers')
_logger = logging.getLogger(__name__)

5
base_phone/report_sxw_format.py

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

5
base_phone/wizard/number_not_found.py

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

5
crm_phone/wizard/create_crm_phonecall.py

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

Loading…
Cancel
Save