

def migrate(cr, version):
    cr.execute(
        "UPDATE payment_line SET communication = communication2, "
        "communication2 = null "
        "FROM payment_order "
        "WHERE payment_line.order_id = payment_order.id "
        "AND payment_order.state in ('draft', 'open') "
        "AND payment_line.state = 'normal' "
        "AND communication2 is not null")



def migrate(cr, version):
    cr.execute(
        "UPDATE payment_line SET communication = communication2, "
        "communication2 = null "
        "FROM payment_order "
        "WHERE payment_line.order_id = payment_order.id "
        "AND payment_order.state in ('draft', 'open') "
        "AND payment_line.state = 'normal' "
        "AND communication is null"
        "AND communication2 is not null")

Update SQL query with "and communication is null"
Update SQL query with "and communication is null"


  
  
  def migrate(cr, version):
      cr.execute(
          "UPDATE payment_line SET communication = communication2, "
          "communication2 = null "
          "FROM payment_order "
          "WHERE payment_line.order_id = payment_order.id "
          "AND payment_order.state in ('draft', 'open') "
          "AND payment_line.state = 'normal' "
+         "AND communication is null"
          "AND communication2 is not null")
  
Update SQL query with "and communication is null"
## Code Before:


def migrate(cr, version):
    cr.execute(
        "UPDATE payment_line SET communication = communication2, "
        "communication2 = null "
        "FROM payment_order "
        "WHERE payment_line.order_id = payment_order.id "
        "AND payment_order.state in ('draft', 'open') "
        "AND payment_line.state = 'normal' "
        "AND communication2 is not null")

## Instruction:
Update SQL query with "and communication is null"
## Code After:


def migrate(cr, version):
    cr.execute(
        "UPDATE payment_line SET communication = communication2, "
        "communication2 = null "
        "FROM payment_order "
        "WHERE payment_line.order_id = payment_order.id "
        "AND payment_order.state in ('draft', 'open') "
        "AND payment_line.state = 'normal' "
        "AND communication is null"
        "AND communication2 is not null")
