diff --git a/barcodes_generate/models/barcode_generate_mixin.py b/barcodes_generate/models/barcode_generate_mixin.py index 750ddd1b..43d9abf4 100644 --- a/barcodes_generate/models/barcode_generate_mixin.py +++ b/barcodes_generate/models/barcode_generate_mixin.py @@ -4,10 +4,18 @@ # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -import barcode +import logging from openerp import models, fields, api, exceptions +_logger = logging.getLogger(__name__) + +try: + import barcode +except ImportError: + _logger.debug("Cannot import 'barcode' python Librairy.") + barcode = None + class barcode_generate_mixin(models.AbstractModel): _name = 'barcode.generate.mixin'