Browse Source

Merge pull request #1206 from Tecnativa/9.0-module_auto_update-cr_rollback_migrating

[FIX] module_auto_update: Rollback cursor if param exists
pull/1209/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
0b06ba998a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      module_auto_update/migrations/9.0.2.0.0/pre-migrate.py

10
module_auto_update/migrations/9.0.2.0.0/pre-migrate.py

@ -12,10 +12,12 @@ _logger = logging.getLogger(__name__)
def migrate(cr, version):
"""Autoenable deprecated behavior."""
try:
cr.execute(
"INSERT INTO ir_config_parameter (key, value) VALUES (%s, '1')",
(PARAM_DEPRECATED,)
)
with cr.savepoint():
cr.execute(
"""INSERT INTO ir_config_parameter (key, value)
VALUES (%s, '1')""",
(PARAM_DEPRECATED,)
)
_logger.warn("Deprecated features have been autoenabled, see "
"addon's README to know how to upgrade to the new "
"supported autoupdate mechanism.")

Loading…
Cancel
Save