Files
2026-04-16 20:53:53 -04:00

162 lines
7.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Plating product family.
-->
<odoo>
<record id="view_fp_incident_list" model="ir.ui.view">
<field name="name">fp.incident.list</field>
<field name="model">fusion.plating.incident</field>
<field name="arch" type="xml">
<list string="Incident Register" decoration-danger="incident_type in ('injury', 'lost_time', 'medical')" decoration-warning="incident_type == 'first_aid'">
<field name="name"/>
<field name="incident_date"/>
<field name="incident_type"/>
<field name="facility_id"/>
<field name="employee_id"/>
<field name="location"/>
<field name="lost_time_days"/>
<field name="wsib_reportable"/>
<field name="state"/>
</list>
</field>
</record>
<record id="view_fp_incident_form" model="ir.ui.view">
<field name="name">fp.incident.form</field>
<field name="model">fusion.plating.incident</field>
<field name="arch" type="xml">
<form string="Incident">
<header>
<button name="action_start_investigation" type="object" string="Start Investigation" invisible="state != 'draft'"/>
<button name="action_close" type="object" string="Close" invisible="state != 'investigation'"/>
<button name="action_reopen" type="object" string="Reopen" invisible="state != 'closed'"/>
<field name="state" widget="statusbar" statusbar_visible="draft,investigation,closed"/>
</header>
<sheet>
<div class="oe_title">
<label for="name"/>
<h1><field name="name"/></h1>
</div>
<group>
<group string="Incident">
<field name="incident_date"/>
<field name="incident_type"/>
<field name="facility_id"/>
<field name="location"/>
<field name="employee_id"/>
<field name="reported_by_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group string="WSIB / Outcome">
<field name="wsib_reportable"/>
<field name="wsib_form_7_submitted" invisible="not wsib_reportable"/>
<field name="lost_time_days"/>
</group>
</group>
<notebook>
<page string="Description">
<field name="description"/>
</page>
<page string="Immediate Action">
<field name="immediate_action"/>
</page>
<page string="Investigation">
<field name="investigation"/>
</page>
<page string="Root Cause">
<field name="root_cause"/>
</page>
<page string="Corrective Action">
<field name="corrective_action"/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="view_fp_incident_kanban" model="ir.ui.view">
<field name="name">fp.incident.kanban</field>
<field name="model">fusion.plating.incident</field>
<field name="arch" type="xml">
<kanban class="o_fp_incident_kanban">
<field name="id"/>
<field name="name"/>
<field name="incident_type"/>
<field name="incident_date"/>
<field name="facility_id"/>
<field name="employee_id"/>
<field name="state"/>
<templates>
<t t-name="card">
<div class="o_fp_card o_fp_incident_card" t-att-data-type="record.incident_type.raw_value" t-att-data-state="record.state.raw_value">
<div class="d-flex align-items-start justify-content-between">
<div>
<strong class="o_fp_card_title"><field name="name"/></strong>
<div class="text-muted small"><field name="incident_type"/></div>
</div>
<i class="fa fa-exclamation-triangle text-muted" aria-hidden="true"/>
</div>
<div class="mt-2 small">
<div><field name="incident_date"/></div>
<div><field name="facility_id"/></div>
<div><field name="employee_id"/></div>
<span class="o_fp_badge mt-2 d-inline-block" t-att-data-state="record.state.raw_value">
<field name="state"/>
</span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_fp_incident_search" model="ir.ui.view">
<field name="name">fp.incident.search</field>
<field name="model">fusion.plating.incident</field>
<field name="arch" type="xml">
<search string="Incidents">
<field name="name"/>
<field name="employee_id"/>
<field name="facility_id"/>
<field name="location"/>
<filter string="Draft" name="filter_draft" domain="[('state', '=', 'draft')]"/>
<filter string="Investigation" name="filter_investigation" domain="[('state', '=', 'investigation')]"/>
<filter string="Closed" name="filter_closed" domain="[('state', '=', 'closed')]"/>
<separator/>
<filter string="WSIB Reportable" name="filter_wsib" domain="[('wsib_reportable', '=', True)]"/>
<filter string="Lost-Time" name="filter_lost_time" domain="[('incident_type', '=', 'lost_time')]"/>
<filter string="Near Miss" name="filter_near_miss" domain="[('incident_type', '=', 'near_miss')]"/>
<group>
<filter string="Type" name="group_type" context="{'group_by': 'incident_type'}"/>
<filter string="Facility" name="group_facility" context="{'group_by': 'facility_id'}"/>
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
</group>
</search>
</field>
</record>
<record id="action_fp_incident" model="ir.actions.act_window">
<field name="name">Incident Register</field>
<field name="res_model">fusion.plating.incident</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_fp_incident_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Log an incident, near-miss or first-aid event
</p>
<p>
Capture every safety event — even close calls — and walk it
through investigation to closure with a documented root
cause and corrective action.
</p>
</field>
</record>
</odoo>