You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
837 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2018 Tecnativa - Jairo Llopis
  3. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
  4. import logging
  5. from psycopg2 import IntegrityError
  6. from openerp.addons.module_auto_update.models.module_deprecated import \
  7. PARAM_DEPRECATED
  8. _logger = logging.getLogger(__name__)
  9. def migrate(cr, version):
  10. """Autoenable deprecated behavior."""
  11. try:
  12. cr.execute(
  13. "INSERT INTO ir_config_parameter (key, value) VALUES (%s, '1')",
  14. (PARAM_DEPRECATED,)
  15. )
  16. _logger.warn("Deprecated features have been autoenabled, see "
  17. "addon's README to know how to upgrade to the new "
  18. "supported autoupdate mechanism.")
  19. except IntegrityError:
  20. _logger.info("Deprecated features setting exists, not autoenabling")