Files
Odoo-Modules/fusion_clock/wizard/clock_nfc_enrollment_views.xml
gsinghpal c2646f59c4 feat(fusion_clock): NFC card enrollment wizard + employee form field
Adds a tap-driven enrollment workflow so managers can pair NFC/RFID
cards to employees using a USB HID reader at their desk:

- New wizard model fusion.clock.nfc.enrollment.wizard with auto-focused
  Card UID field, employee picker, and reassignment warning if the
  card is already held by someone else.
- Two actions: 'Enroll Card' (single) and 'Enroll & Next' (bulk).
- Menu entry under Fusion Clock root, manager-gated.
- Exposes x_fclk_nfc_card_uid on the Employee form Clock Settings
  section (next to Kiosk PIN) so it can be inspected/edited directly.
- Bumps manifest to 19.0.3.1.0 for asset cache bust.

Wizard reuses FusionClockNfcKiosk._normalize_uid so stored format
matches what the kiosk /tap endpoint looks up later. Reassignment
clears the UID from the previous holder and logs both events to the
activity log under 'card_enrollment'.
2026-05-15 18:55:42 -04:00

62 lines
2.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Enrollment Wizard Form -->
<record id="view_fusion_clock_nfc_enrollment_wizard_form" model="ir.ui.view">
<field name="name">fusion.clock.nfc.enrollment.wizard.form</field>
<field name="model">fusion.clock.nfc.enrollment.wizard</field>
<field name="arch" type="xml">
<form string="Enroll NFC Card">
<sheet>
<div class="alert alert-info" role="alert">
<strong>How to enroll:</strong> Tap an NFC card on the USB reader connected
to this computer. The reader will type the UID into the field below.
Then select the employee and click <b>Enroll Card</b> (or
<b>Enroll &amp; Next</b> to keep enrolling).
</div>
<group>
<field name="card_uid"
placeholder="Tap card on reader, or paste UID manually"/>
<field name="normalized_uid"
invisible="not normalized_uid"
readonly="1"/>
<field name="warning_message"
invisible="not warning_message"
readonly="1"
nolabel="1"
colspan="2"/>
<field name="existing_employee_id" invisible="1"/>
<field name="employee_id"
options="{'no_create': True, 'no_create_edit': True}"/>
</group>
</sheet>
<footer>
<button name="action_enroll"
string="Enroll Card"
type="object"
class="btn-primary"
invisible="not normalized_uid or not employee_id"/>
<button name="action_enroll_and_next"
string="Enroll &amp; Next"
type="object"
class="btn-secondary"
invisible="not normalized_uid or not employee_id"/>
<button special="cancel"
string="Cancel"
class="btn-secondary"/>
</footer>
</form>
</field>
</record>
<!-- Action to open the wizard -->
<record id="action_fusion_clock_nfc_enrollment_wizard" model="ir.actions.act_window">
<field name="name">Enroll NFC Card</field>
<field name="res_model">fusion.clock.nfc.enrollment.wizard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_fusion_clock_nfc_enrollment_wizard_form"/>
<field name="target">new</field>
</record>
</odoo>