Browse Source

protect import of external dependencies

Odoo won't install an addon if the external dependencies are not met.
However, the python modules of the addons are imported at startup, and the
lack of an external dependency for an external addon will cause a crash,
therefore the import needs to be in a try..except block.

closes #100
pull/101/head
Alexandre Fayolle 10 years ago
parent
commit
84c8896bda
  1. 6
      base_location_geonames_import/wizard/geonames_import.py

6
base_location_geonames_import/wizard/geonames_import.py

@ -27,11 +27,15 @@ from openerp.exceptions import Warning
import requests import requests
import tempfile import tempfile
import StringIO import StringIO
import unicodecsv
import zipfile import zipfile
import os import os
import logging import logging
try:
import unicodecsv
except ImportError:
unicodecsv = None
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

Loading…
Cancel
Save