diff --git a/pos_pricelist/__init__.py b/pos_pricelist/__init__.py index 10e21b51..5919be3a 100644 --- a/pos_pricelist/__init__.py +++ b/pos_pricelist/__init__.py @@ -2,4 +2,9 @@ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). from .hooks import post_init_hook -from . import models +try: + from . import models +except ImportError: # pragma: no-cover + import logging + _logger = logging.getLogger(__name__) + _logger.warn("Missing dependency", exc_info=True) diff --git a/pos_pricelist/models/pos_config.py b/pos_pricelist/models/pos_config.py index e30b03af..a6da8a69 100644 --- a/pos_pricelist/models/pos_config.py +++ b/pos_pricelist/models/pos_config.py @@ -4,15 +4,11 @@ from odoo import _, api, fields, models from odoo.exceptions import ValidationError +from oca.decorators import foreach # pylint: disable=W7935 import logging _logger = logging.getLogger(__name__) -try: - from oca.decorators import foreach -except ImportError: # pragma: no-cover - _logger.warn("Missing dependency", exc_info=True) - class PosConfig(models.Model): _inherit = 'pos.config'