# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) """Backfill leave-request end dates on upgrade to 19.0.3.13.0. Leave requests gained a `date_to` (end of a multi-day range). Existing single-day requests have no end date; set it to the start date so they keep being treated as one-day leaves by the absence check and reports. """ def migrate(cr, version): if not version: return cr.execute( "UPDATE fusion_clock_leave_request SET date_to = leave_date WHERE date_to IS NULL" )