feat(shopfloor): audit log list+form views, Owner-only menu
Plating > Configuration > Tablet Audit Log. Read-only list with decoration (green=unlock, red=failed, warning=ceiling/force, muted=manual/idle). Form shows full forensic detail incl. ip/ua. Owner-only via groups=fusion_plating.group_fp_owner on the menu. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- Placeholder for fp.tablet.session.event list + form views,
|
||||
action, and Owner-only menu added in Phase E task E1.
|
||||
File registered in manifest to keep the data list stable
|
||||
across phase boundaries. -->
|
||||
<data>
|
||||
|
||||
<record id="view_fp_tablet_session_event_list" model="ir.ui.view">
|
||||
<field name="name">fp.tablet.session.event.list</field>
|
||||
<field name="model">fp.tablet.session.event</field>
|
||||
<field name="arch" type="xml">
|
||||
<list decoration-success="event_type == 'unlock'"
|
||||
decoration-danger="event_type == 'failed_unlock'"
|
||||
decoration-warning="event_type in ('ceiling_lock','force_lock')"
|
||||
decoration-muted="event_type in ('manual_lock','idle_lock')"
|
||||
create="false" delete="false" edit="false">
|
||||
<field name="create_date" string="When"/>
|
||||
<field name="event_type" widget="badge"/>
|
||||
<field name="user_id"/>
|
||||
<field name="attempted_user_id" optional="hide"/>
|
||||
<field name="failure_reason" optional="hide"/>
|
||||
<field name="duration_seconds" optional="hide" string="Duration (s)"/>
|
||||
<field name="acting_uid" optional="hide" string="Acting"/>
|
||||
<field name="ip_address" optional="hide"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_fp_tablet_session_event_form" model="ir.ui.view">
|
||||
<field name="name">fp.tablet.session.event.form</field>
|
||||
<field name="model">fp.tablet.session.event</field>
|
||||
<field name="arch" type="xml">
|
||||
<form create="false" delete="false" edit="false">
|
||||
<sheet>
|
||||
<h1><field name="event_type" readonly="1"/></h1>
|
||||
<group>
|
||||
<group>
|
||||
<field name="user_id" readonly="1"/>
|
||||
<field name="attempted_user_id" readonly="1"/>
|
||||
<field name="failure_reason" readonly="1"/>
|
||||
<field name="acting_uid" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="create_date" readonly="1"/>
|
||||
<field name="session_started_at" readonly="1"/>
|
||||
<field name="session_ended_at" readonly="1"/>
|
||||
<field name="duration_seconds" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Forensic">
|
||||
<field name="ip_address" readonly="1"/>
|
||||
<field name="user_agent" readonly="1"/>
|
||||
<field name="session_id_hash" readonly="1"/>
|
||||
</group>
|
||||
<group string="Notes">
|
||||
<field name="notes" readonly="1" nolabel="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_fp_tablet_session_event" model="ir.actions.act_window">
|
||||
<field name="name">Tablet Audit Log</field>
|
||||
<field name="res_model">fp.tablet.session.event</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_fp_tablet_session_event"
|
||||
name="Tablet Audit Log"
|
||||
parent="fusion_plating.menu_fp_config"
|
||||
action="action_fp_tablet_session_event"
|
||||
sequence="20"
|
||||
groups="fusion_plating.group_fp_owner"/>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user