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 e0026cda62
commit 8e0b3e2afa

View File

@@ -22,7 +22,11 @@
from openerp import models, fields, api
from openerp.addons.decimal_precision import decimal_precision as dp
from unidecode import unidecode
try:
from unidecode import unidecode
except ImportError:
unidecode = None
class BankingExportSepa(models.Model):