<commit_before># -*- coding: utf-8 -*-
# © 2015 <NAME> (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
"""
The banks have been created with dumb xml ids.
Change xml ids to keep track of those bank with
http://www.six-interbank-clearing.com/ (see README.rst for source)
"""


def migrate(cr, version):
    if not version:
        return

    query = (
        "UPDATE ir_model_data"
        "  SET name = 'bank_'||res_bank.clearing||_||res_bank.bank_branchid"
        "  FROM res_bank"
        "  WHERE module = 'l10n_ch_bank'"
        "    AND model = 'res.bank'"
        "    AND res_id = res_bank.id"
        "    AND res_bank.active = TRUE")
    cr.execute(query)
<commit_msg>Update pre-migration.py<commit_after># -*- coding: utf-8 -*-
# © 2015 <NAME> (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
"""
The banks have been created with dumb xml ids.
Change xml ids to keep track of those bank with
http://www.six-interbank-clearing.com/ (see README.rst for source)
"""


def migrate(cr, version):
    if not version:
        return

    query = (
        "UPDATE ir_model_data"
        "  SET name = 'bank_'||res_bank.clearing||'_'||res_bank.bank_branchid"
        "  FROM res_bank"
        "  WHERE module = 'l10n_ch_bank'"
        "    AND model = 'res.bank'"
        "    AND res_id = res_bank.id"
        "    AND res_bank.active = TRUE")
    cr.execute(query)

{'fraction_non_alphanumeric': 0.1371191135734072, 'fraction_numerical': 0.012465373961218837, 'mean_word_length': 2.4903381642512077, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '248852', 'n_tokens_mistral': 514, 'n_tokens_neox': 493, 'n_words': 131}