Browse Source

Merge pull request #250 from grupoesoc/deprecation-warning-for-installed

[8.0][FIX][base_contact] Only warn when installed.
pull/254/head
Rafael Blasco 9 years ago
parent
commit
5305427ceb
  1. 11
      base_contact/__init__.py
  2. 2
      base_contact/__openerp__.py
  3. 5
      base_contact/models/__init__.py
  4. 18
      base_contact/models/ir_model.py

11
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

2
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',

5
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

18
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)
Loading…
Cancel
Save