Browse Source

FIX _logger is now really available for the except

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

7
base_phone/base_phone.py

@ -23,13 +23,14 @@ from openerp import models, fields, api, _
from openerp.tools.safe_eval import safe_eval from openerp.tools.safe_eval import safe_eval
from openerp.exceptions import Warning from openerp.exceptions import Warning
import logging import logging
_logger = logging.getLogger(__name__)
# Lib for phone number reformating -> pip install phonenumbers # Lib for phone number reformating -> pip install phonenumbers
try: try:
import phonenumbers import phonenumbers
except ImportError: except ImportError:
logger.debug('Cannot import phonenumbers')
_logger = logging.getLogger(__name__)
_logger.debug('Cannot import phonenumbers')
class PhoneCommon(models.AbstractModel): class PhoneCommon(models.AbstractModel):

6
base_phone/report_sxw_format.py

@ -21,10 +21,14 @@
from openerp.osv import orm from openerp.osv import orm
from openerp.report import report_sxw from openerp.report import report_sxw
import logging
_logger = logging.getLogger(__name__)
try: try:
import phonenumbers import phonenumbers
except ImportError: except ImportError:
logger.debug('Cannot import phonenumbers')
_logger.debug('Cannot import phonenumbers')
class base_phone_installed(orm.AbstractModel): class base_phone_installed(orm.AbstractModel):

7
base_phone/wizard/number_not_found.py

@ -22,12 +22,13 @@
from openerp.osv import orm, fields from openerp.osv import orm, fields
from openerp.tools.translate import _ from openerp.tools.translate import _
import logging import logging
_logger = logging.getLogger(__name__)
try: try:
import phonenumbers import phonenumbers
except ImportError: except ImportError:
logger.debug('Cannot import phonenumbers')
_logger = logging.getLogger(__name__)
_logger.debug('Cannot import phonenumbers')
class number_not_found(orm.TransientModel): class number_not_found(orm.TransientModel):

6
crm_phone/wizard/create_crm_phonecall.py

@ -21,10 +21,14 @@
############################################################################## ##############################################################################
from openerp import models, api, _ from openerp import models, api, _
import logging
_logger = logging.getLogger(__name__)
try: try:
import phonenumbers import phonenumbers
except ImportError: except ImportError:
logger.debug('Cannot import phonenumbers')
_logger.debug('Cannot import phonenumbers')
class wizard_create_crm_phonecall(models.TransientModel): class wizard_create_crm_phonecall(models.TransientModel):

Loading…
Cancel
Save