mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[ADD] currency_rate_update migration script
This commit is contained in:
20
currency_rate_update/migrations/9.0.1.1/post-migration.py
Normal file
20
currency_rate_update/migrations/9.0.1.1/post-migration.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Tecnativa - Vicent Cubells
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openupgradelib import openupgrade
|
||||
|
||||
|
||||
def migrate_currency_rate_update(env):
|
||||
""" Update field value because service selection field has changed """
|
||||
query = """
|
||||
UPDATE currency_rate_update_service
|
||||
SET {0}=replace({0}, '_getter', '')
|
||||
WHERE {0} like '%_getter'
|
||||
"""
|
||||
env.cr.execute(query.format('service'))
|
||||
|
||||
|
||||
@openupgrade.migrate(use_env=True)
|
||||
def migrate(env, version):
|
||||
migrate_currency_rate_update(env)
|
||||
Reference in New Issue
Block a user