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. 4
      module_auto_update/migrations/9.0.2.0.0/pre-migrate.py

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

@ -12,8 +12,10 @@ _logger = logging.getLogger(__name__)
def migrate(cr, version): def migrate(cr, version):
"""Autoenable deprecated behavior.""" """Autoenable deprecated behavior."""
try: try:
with cr.savepoint():
cr.execute( cr.execute(
"INSERT INTO ir_config_parameter (key, value) VALUES (%s, '1')",
"""INSERT INTO ir_config_parameter (key, value)
VALUES (%s, '1')""",
(PARAM_DEPRECATED,) (PARAM_DEPRECATED,)
) )
_logger.warn("Deprecated features have been autoenabled, see " _logger.warn("Deprecated features have been autoenabled, see "

Loading…
Cancel
Save