Files
Odoo-Modules/fusion_clock/models
gsinghpal 136a64ea21 fix(fusion_clock): enforce NFC card-UID uniqueness via declarative UniqueIndex
Odoo 19 silently ignores the legacy `_sql_constraints` list (repo CLAUDE.md
rule 9), so it never created a DB constraint — two employees could be assigned
the same x_fclk_nfc_card_uid and the NFC tap's search(limit=1) then picked an
arbitrary one. Replace it with a declarative models.UniqueIndex carrying a
partial WHERE predicate, so uniqueness is enforced only when a UID is set;
employees without a card keep sharing a blank/NULL value.

Makes test_nfc_models.TestNfcModels.test_card_uid_is_unique_when_set pass.
Verified on entech (DB admin): 0 pre-existing duplicate UIDs, full upgrade +
61/61 fusion_clock tests green, and the unique partial index
hr_employee_fclk_nfc_card_uid_unique now exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 22:34:14 -04:00
..
2026-05-30 20:59:59 -04:00
2026-05-23 07:53:41 -04:00
2026-05-23 07:53:41 -04:00
2026-02-27 14:32:32 -05:00
2026-02-27 14:32:32 -05:00
2026-03-09 15:21:22 -04:00
2026-02-27 14:32:32 -05:00
2026-03-16 08:14:56 -04:00
2026-03-16 08:14:56 -04:00