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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
4 deletions
-
module_auto_update/migrations/9.0.2.0.0/pre-migrate.py
|
@ -12,10 +12,12 @@ _logger = logging.getLogger(__name__) |
|
|
def migrate(cr, version): |
|
|
def migrate(cr, version): |
|
|
"""Autoenable deprecated behavior.""" |
|
|
"""Autoenable deprecated behavior.""" |
|
|
try: |
|
|
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 " |
|
|
_logger.warn("Deprecated features have been autoenabled, see " |
|
|
"addon's README to know how to upgrade to the new " |
|
|
"addon's README to know how to upgrade to the new " |
|
|
"supported autoupdate mechanism.") |
|
|
"supported autoupdate mechanism.") |
|
|