Files
Odoo-Modules/fusion_clock/views/hr_employee_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

162 lines
9.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Employee Form: Fusion Clock Tab -->
<record id="view_employee_form_fusion_clock" model="ir.ui.view">
<field name="name">hr.employee.form.fusion.clock</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Fusion Clock" name="fusion_clock_tab"
groups="fusion_clock.group_fusion_clock_manager,fusion_clock.group_fusion_clock_team_lead">
<!-- Configuration & Status -->
<group>
<group string="Configuration">
<field name="x_fclk_enable_clock"/>
<field name="x_fclk_shift_id"/>
<field name="x_fclk_default_location_id"/>
<field name="x_fclk_break_minutes"/>
<field name="x_fclk_kiosk_pin" password="True"
groups="fusion_clock.group_fusion_clock_manager"/>
<field name="x_fclk_nfc_card_uid"
placeholder="Tap card on USB reader, or paste UID"
groups="fusion_clock.group_fusion_clock_manager"/>
</group>
<group string="Status">
<field name="x_fclk_ontime_streak"/>
<field name="x_fclk_absences_this_month"/>
<field name="x_fclk_absences_this_year"/>
<field name="x_fclk_overtime_this_week" widget="float_time"/>
<field name="x_fclk_overtime_this_month" widget="float_time"/>
<field name="x_fclk_pending_reason"/>
</group>
</group>
<!-- Activity Log Sub-Tabs -->
<notebook>
<page string="Clock Events" name="fclk_sub_clock_events">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', 'in', ['clock_in', 'clock_out'])]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="log_type"/>
<field name="description"/>
<field name="location_id"/>
<field name="source"/>
</list>
</field>
</page>
<page string="Penalties" name="fclk_sub_penalties">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', 'in', ['late_clock_in', 'early_clock_out'])]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="log_type"/>
<field name="description"/>
</list>
</field>
</page>
<page string="Geofence" name="fclk_sub_geofence">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', 'in', ['outside_geofence', 'ip_fallback'])]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="log_type"/>
<field name="description"/>
<field name="latitude"/>
<field name="longitude"/>
<field name="distance"/>
</list>
</field>
</page>
<page string="System" name="fclk_sub_system">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', 'in', ['auto_clock_out', 'missed_clock_out'])]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="log_type"/>
<field name="description"/>
<field name="attendance_id"/>
</list>
</field>
</page>
<page string="Absences" name="fclk_sub_absences">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', '=', 'absent')]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="description"/>
</list>
</field>
</page>
<page string="Leave Requests" name="fclk_sub_leaves">
<field name="x_fclk_leave_request_ids" nolabel="1" colspan="2">
<list create="false" delete="false" limit="20" default_order="leave_date desc">
<field name="leave_date"/>
<field name="reason"/>
<field name="state"/>
<field name="created_from"/>
</list>
</field>
</page>
<page string="Reasons" name="fclk_sub_reasons">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', '=', 'reason_provided')]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="description"/>
</list>
</field>
</page>
<page string="Overtime" name="fclk_sub_overtime">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', '=', 'overtime')]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="description"/>
<field name="attendance_id"/>
</list>
</field>
</page>
<page string="Corrections" name="fclk_sub_corrections">
<field name="x_fclk_correction_ids" nolabel="1" colspan="2">
<list create="false" delete="false" limit="20">
<field name="attendance_id"/>
<field name="requested_check_in"/>
<field name="requested_check_out"/>
<field name="reason"/>
<field name="state" decoration-success="state == 'approved'"
decoration-danger="state == 'rejected'"
decoration-warning="state == 'pending'"/>
</list>
</field>
</page>
<page string="Streaks" name="fclk_sub_streaks">
<field name="x_fclk_activity_log_ids" nolabel="1" colspan="2"
domain="[('log_type', '=', 'streak_milestone')]">
<list create="false" delete="false" limit="20" default_order="log_date desc">
<field name="log_date"/>
<field name="description"/>
</list>
</field>
</page>
</notebook>
</page>
</xpath>
</field>
</record>
</odoo>