feat(shopfloor): per-user 7-day tablet event smart button
Owner-only smart button on res.users form. Click opens the audit log filtered to that user (both user_id and attempted_user_id, so failed unlock attempts against a tile show up too). Compute is non-stored: search_count on the audit model per user on demand. Sudo'd because the audit model has Owner-only ACL — the compute fires for the form-viewing user (Owner) who would see the results anyway via the menu. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -55,4 +55,30 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- =================================================================
|
||||
(c) res.users form — Owner-only smart button: Tablet Events (7d)
|
||||
Counts unlock/lock/failed events for this user across the last
|
||||
7 days. Clicking opens the audit log filtered to this user
|
||||
(both user_id and attempted_user_id, so failed-tile-tap attempts
|
||||
show up too).
|
||||
================================================================= -->
|
||||
<record id="view_users_form_tablet_event_smart_button" model="ir.ui.view">
|
||||
<field name="name">res.users.form.tablet.event.smart.button</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_view_tablet_events"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-history"
|
||||
groups="fusion_plating.group_fp_owner">
|
||||
<field name="x_fc_tablet_event_count_7d"
|
||||
widget="statinfo"
|
||||
string="Tablet Events (7d)"/>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user