# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) """One-time reset of stale missed-clock-out flags on upgrade to 19.0.4.1.0. Background: x_fclk_pending_reason was set by the absence + auto-clock-out crons but only cleared by the systray reason dialog -- never by the kiosk / NFC clock paths that staff actually use. During the kiosk rollout the absence cron flagged essentially the whole company (hundreds of "absent" logs), and those flags then nagged everyone forever, even while currently clocked in. This release clears the flag on every clock-in (all paths), stops absences from setting it at all, and exempts owners. The flags already on record are stale artifacts of the rollout, so wipe them once here; correct ones re-appear only for a genuine forgotten clock-out from now on. """ def migrate(cr, version): if not version: return cr.execute( "UPDATE hr_employee SET x_fclk_pending_reason = false " "WHERE x_fclk_pending_reason = true" )