From 8e0b3e2afac08f9cf2ef957ebe7937d2f129c733 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Wed, 25 Mar 2015 09:11:12 +0100 Subject: [PATCH] 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. --- .../models/account_banking_sepa.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/account_banking_sepa_credit_transfer/models/account_banking_sepa.py b/account_banking_sepa_credit_transfer/models/account_banking_sepa.py index cace58820..f463a5050 100644 --- a/account_banking_sepa_credit_transfer/models/account_banking_sepa.py +++ b/account_banking_sepa_credit_transfer/models/account_banking_sepa.py @@ -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):