from openupgradelib import openupgrade


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

    # Update data
    openupgrade.load_xml(
        cr, "partner_communication_switzerland", "data/onboarding_process.xml")

from openupgradelib import openupgrade


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

    # Copy start_date over onboarding_start_date
    cr.execute("""
        UPDATE recurring_contract
        SET onboarding_start_date = start_date
        WHERE is_first_sponsorship = true
    """)
    # Update data
    openupgrade.load_xml(
        cr, "partner_communication_switzerland", "data/onboarding_process.xml")

Include migration for current runnning onboarding processes
Include migration for current runnning onboarding processes

  from openupgradelib import openupgrade
  
  
  def migrate(cr, installed_version):
      if not installed_version:
          return
  
+     # Copy start_date over onboarding_start_date
+     cr.execute("""
+         UPDATE recurring_contract
+         SET onboarding_start_date = start_date
+         WHERE is_first_sponsorship = true
+     """)
      # Update data
      openupgrade.load_xml(
          cr, "partner_communication_switzerland", "data/onboarding_process.xml")
  
Include migration for current runnning onboarding processes
## Code Before:
from openupgradelib import openupgrade


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

    # Update data
    openupgrade.load_xml(
        cr, "partner_communication_switzerland", "data/onboarding_process.xml")

## Instruction:
Include migration for current runnning onboarding processes
## Code After:
from openupgradelib import openupgrade


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

    # Copy start_date over onboarding_start_date
    cr.execute("""
        UPDATE recurring_contract
        SET onboarding_start_date = start_date
        WHERE is_first_sponsorship = true
    """)
    # Update data
    openupgrade.load_xml(
        cr, "partner_communication_switzerland", "data/onboarding_process.xml")
