feat(fusion_clock): add x_fclk_nfc_card_uid to hr.employee
Adds the NFC card UID field (Char, unique, manager-only) that the kiosk will use to identify employees by card tap. Includes the tests package with three post-install tests covering write, uniqueness, and nullable multi-row behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,25 @@ class HrEmployee(models.Model):
|
||||
groups="fusion_clock.group_fusion_clock_manager",
|
||||
)
|
||||
|
||||
# NFC card (kiosk identification)
|
||||
x_fclk_nfc_card_uid = fields.Char(
|
||||
string='NFC Card UID',
|
||||
index=True,
|
||||
copy=False,
|
||||
groups="fusion_clock.group_fusion_clock_manager",
|
||||
help="Hex UID of the NFC card assigned to this employee. "
|
||||
"Format: uppercase, colon-separated, e.g. 04:A2:B5:62:C1:80. "
|
||||
"Same card the employee uses for door access.",
|
||||
)
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
'fclk_nfc_card_uid_unique',
|
||||
'UNIQUE(x_fclk_nfc_card_uid)',
|
||||
'This NFC card is already assigned to another employee.',
|
||||
),
|
||||
]
|
||||
|
||||
# On-time streak
|
||||
x_fclk_ontime_streak = fields.Integer(
|
||||
string='On-Time Streak',
|
||||
|
||||
Reference in New Issue
Block a user