feat(fusion_clock): add NFC Clock Kiosk settings block
Extends res.config.settings with 5 NFC kiosk fields (enable toggle, photo required, enroll password, debug mode, kiosk location via related company field) and adds the corresponding settings view block with conditional sub-fields hidden until the kiosk is enabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -232,6 +232,41 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
help="Custom column names for CSV export (JSON format). Leave blank for defaults.",
|
help="Custom column names for CSV export (JSON format). Leave blank for defaults.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# ── NFC Clock Kiosk ────────────────────────────────────────────────
|
||||||
|
fclk_enable_nfc_kiosk = fields.Boolean(
|
||||||
|
string='Enable NFC Clock Kiosk',
|
||||||
|
config_parameter='fusion_clock.enable_nfc_kiosk',
|
||||||
|
default=False,
|
||||||
|
help="Enable the tap-to-clock NFC kiosk page at /fusion_clock/kiosk/nfc.",
|
||||||
|
)
|
||||||
|
fclk_nfc_photo_required = fields.Boolean(
|
||||||
|
string='Require Photo on Tap',
|
||||||
|
config_parameter='fusion_clock.nfc_photo_required',
|
||||||
|
default=True,
|
||||||
|
help="If enabled, the kiosk rejects taps when the front camera is unavailable. "
|
||||||
|
"Recommended for buddy-punch deterrence.",
|
||||||
|
)
|
||||||
|
fclk_nfc_enroll_password = fields.Char(
|
||||||
|
string='Enroll Mode Password',
|
||||||
|
config_parameter='fusion_clock.nfc_enroll_password',
|
||||||
|
help="Short password the manager types on the kiosk to enter Enroll Mode. "
|
||||||
|
"Leave empty to fall back to manager-group membership only.",
|
||||||
|
)
|
||||||
|
fclk_nfc_kiosk_debug = fields.Boolean(
|
||||||
|
string='Enable Mock-Tap Debug',
|
||||||
|
config_parameter='fusion_clock.nfc_kiosk_debug',
|
||||||
|
default=False,
|
||||||
|
help="Enables a Ctrl+Shift+T keyboard shortcut on the kiosk page for "
|
||||||
|
"simulating a tap with a configurable UID. Off in production.",
|
||||||
|
)
|
||||||
|
fclk_nfc_kiosk_location_id = fields.Many2one(
|
||||||
|
related='company_id.x_fclk_nfc_kiosk_location_id',
|
||||||
|
readonly=False,
|
||||||
|
string='NFC Kiosk Location',
|
||||||
|
help="Which clock location is bound to the NFC kiosk for this company. "
|
||||||
|
"Required when the kiosk is enabled.",
|
||||||
|
)
|
||||||
|
|
||||||
def set_values(self):
|
def set_values(self):
|
||||||
super().set_values()
|
super().set_values()
|
||||||
ICP = self.env['ir.config_parameter'].sudo()
|
ICP = self.env['ir.config_parameter'].sudo()
|
||||||
|
|||||||
@@ -242,6 +242,34 @@
|
|||||||
</setting>
|
</setting>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
<!-- ============================================================ -->
|
||||||
|
<!-- NFC Clock Kiosk -->
|
||||||
|
<!-- ============================================================ -->
|
||||||
|
<block title="NFC Clock Kiosk" name="fclk_nfc_kiosk">
|
||||||
|
<setting id="fclk_nfc_enable" string="Enable NFC Kiosk"
|
||||||
|
help="Tap-to-clock kiosk for shop-floor tablets at /fusion_clock/kiosk/nfc">
|
||||||
|
<field name="fclk_enable_nfc_kiosk"/>
|
||||||
|
<div class="content-group" invisible="not fclk_enable_nfc_kiosk">
|
||||||
|
<div class="row mt16">
|
||||||
|
<label for="fclk_nfc_kiosk_location_id" string="Location" class="col-lg-5 o_light_label"/>
|
||||||
|
<field name="fclk_nfc_kiosk_location_id"/>
|
||||||
|
</div>
|
||||||
|
<div class="row mt8">
|
||||||
|
<label for="fclk_nfc_photo_required" string="Require Photo" class="col-lg-5 o_light_label"/>
|
||||||
|
<field name="fclk_nfc_photo_required"/>
|
||||||
|
</div>
|
||||||
|
<div class="row mt8">
|
||||||
|
<label for="fclk_nfc_enroll_password" string="Enroll Password" class="col-lg-5 o_light_label"/>
|
||||||
|
<field name="fclk_nfc_enroll_password" password="True"/>
|
||||||
|
</div>
|
||||||
|
<div class="row mt8">
|
||||||
|
<label for="fclk_nfc_kiosk_debug" string="Mock-Tap Debug" class="col-lg-5 o_light_label"/>
|
||||||
|
<field name="fclk_nfc_kiosk_debug"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</setting>
|
||||||
|
</block>
|
||||||
|
|
||||||
</app>
|
</app>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user