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.
This commit is contained in:
Alexandre Fayolle
2015-03-25 09:11:12 +01:00
committed by Enric Tobella
parent 2c05a79eb0
commit c9c352bdd7

View File

@@ -24,12 +24,17 @@ from openerp.osv import orm
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval
from datetime import datetime
from unidecode import unidecode
from lxml import etree
from openerp import tools
import logging
import base64
try:
from unidecode import unidecode
except ImportError:
unidecode = None
logger = logging.getLogger(__name__)