<commit_before># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = logging.getLogger(__name__)

def migrate(cr, version):
    _logger.info('Migrating account_check from version %s' % version)

    cr.execute("""
INSERT INTO account_check (
 id, create_uid, create_date, write_date, write_uid,
 state, number, issue_date, amount, company_id, user_id, voucher_id,
 clearing, bank_id, vat, type,
 source_partner_id, destiny_partner_id,
 payment_date
)
SELECT id, create_uid, create_date, write_date, write_uid,
 state, CAST(number AS INT), date, amount, company_id, user_id, voucher_id,
 clearing, bank_id, vat, 'third',
 source_partner_id, destiny_partner_id,
 clearing_date
FROM account_third_check
        """)
    pass<commit_msg>[FIX] Set last id in sequence<commit_after># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = logging.getLogger(__name__)

def migrate(cr, version):
    _logger.info('Migrating account_check from version %s' % version)

    cr.execute("""
INSERT INTO account_check (
 id, create_uid, create_date, write_date, write_uid,
 state, number, issue_date, amount, company_id, user_id, voucher_id,
 clearing, bank_id, vat, type,
 source_partner_id, destiny_partner_id,
 payment_date
)
SELECT id, create_uid, create_date, write_date, write_uid,
 state, CAST(number AS INT), date, amount, company_id, user_id, voucher_id,
 clearing, bank_id, vat, 'third',
 source_partner_id, destiny_partner_id,
 clearing_date
FROM account_third_check
        """)

    cr.execute("select max(id) FROM account_check")
    take_last_check = cr.fetchall()[0][0]
    cr.execute("ALTER SEQUENCE account_check_id_seq RESTART WITH %s;", (take_last_check,))

    pass
{'fraction_non_alphanumeric': 0.2296127562642369, 'fraction_numerical': 0.0018223234624145787, 'mean_word_length': 6.494880546075085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7051177', 'n_tokens_mistral': 669, 'n_tokens_neox': 636, 'n_words': 173}