How to use the openupgradelib.openupgrade function in openupgradelib

To help you get started, we’ve selected a few openupgradelib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ingadhoc / odoo-public-administration / public_budget / migrations / 9.0.1.33.0 / post-migration.py View on Github external
@openupgrade.migrate(use_env=True)
def migrate(env, version):
    """ Completamos fecha a nuevo campo:
    * tomando de payment_date si está seteado
    * tomando de confirmation_date si ya se paso a proceso de firma pero no
    tenemos payment_date
    """
    cr = env.cr

    cr.execute("""
        UPDATE account_payment_group set to_signature_date=payment_date
        WHERE payment_date is not null
    """)

    cr.execute("""
        UPDATE account_payment_group set to_signature_date=confirmation_date