def migrate(cr, version):
    # xeno.hr.announcement's old single `date` field is being replaced by
    # start_date/end_date. The column still physically exists (Odoo never
    # auto-drops columns for removed fields) -- backfill the new ones from
    # it before it becomes orphaned, so the one real announcement already
    # in production isn't silently blanked.
    #
    # No "WHERE start_date IS NULL" guard: by the time a post-migrate
    # script runs, Odoo's own _auto_init has already added the new
    # required start_date/end_date columns and backfilled every existing
    # row with today's date (the field's own default, computed for the
    # NOT NULL constraint) -- so start_date is NEVER actually null here,
    # and a null-guarded UPDATE silently matches nothing. Overwrite
    # unconditionally from the old column instead.
    cr.execute("""
        UPDATE xeno_hr_announcement
        SET start_date = date, end_date = date
        WHERE date IS NOT NULL
    """)
