diff --git a/base_contact/__init__.py b/base_contact/__init__.py index 1b67c0a1c..24ac1e9a7 100644 --- a/base_contact/__init__.py +++ b/base_contact/__init__.py @@ -20,13 +20,4 @@ # ############################################################################## -import logging -import os - - -_logger = logging.getLogger(__name__ + ".deprecated") - -# Skip warnings on runbots -_method = _logger.info if "OCA_RUNBOT" in os.environ else _logger.warning -_method("This module is DEPRECATED. See %s/README.rst.", - os.path.dirname(__file__)) +from . import models diff --git a/base_contact/__openerp__.py b/base_contact/__openerp__.py index 7e795a129..e6ee7dae1 100644 --- a/base_contact/__openerp__.py +++ b/base_contact/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Contacts Management', 'summary': u"[DEPRECATED] Manage your contacts separately", - 'version': '8.0.2.0.0', + 'version': '8.0.2.0.1', 'author': "OpenERP SA,Odoo Community Association (OCA)", 'website': 'http://www.openerp.com', 'category': 'Customer Relationship Management', diff --git a/base_contact/models/__init__.py b/base_contact/models/__init__.py new file mode 100644 index 000000000..d58cd30eb --- /dev/null +++ b/base_contact/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import ir_model diff --git a/base_contact/models/ir_model.py b/base_contact/models/ir_model.py new file mode 100644 index 000000000..65ecb5e01 --- /dev/null +++ b/base_contact/models/ir_model.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging +from openerp import api, models + +_logger = logging.getLogger(__name__) + + +class IrModel(models.Model): + _inherit = "ir.model" + + @api.cr + def _register_hook(self, cr): + """Only warn in installed instances.""" + _logger.info("WARNING: This module is DEPRECATED. See README.") + return super(IrModel, self)._register_hook(cr)