2
0
account-financial-tools/account_loan/migrations/13.0.1.1.0/post-migration.py
Alba Riera e56f6f9e26 [MIG] account_loan: Migration to 13.0
Co-authored-by: Enric Tobella <etobella@creublanca.es>
2023-09-15 11:24:50 +02:00

17 lines
409 B
Python

# Copyright 2021 Creu Blanca - Alba Riera
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
openupgrade.logged_query(
env.cr,
"""
UPDATE account_move am
SET loan_line_id = ai.loan_line_id,
loan_id = ai.loan_id
FROM account_invoice ai
WHERE ai.id = am.old_invoice_id and ai.loan_id is not null""",
)