Files
Odoo-Modules/fusion-plating/fusion_plating_kpi/views/fp_kpi_views.xml
gsinghpal be611876ad changes
2026-04-12 09:09:50 -04:00

147 lines
6.5 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>
<!-- ===== LIST VIEW ===== -->
<record id="fp_kpi_view_list" model="ir.ui.view">
<field name="name">fusion.plating.kpi.list</field>
<field name="model">fusion.plating.kpi</field>
<field name="arch" type="xml">
<list string="KPIs"
decoration-success="trend == 'up'"
decoration-danger="trend == 'down'"
decoration-muted="trend == 'flat'">
<field name="name"/>
<field name="code"/>
<field name="kpi_type"/>
<field name="facility_id" optional="show"/>
<field name="target_value"/>
<field name="current_value"/>
<field name="uom"/>
<field name="trend"/>
<field name="compute_method"/>
<field name="active" column_invisible="True"/>
</list>
</field>
</record>
<!-- ===== FORM VIEW ===== -->
<record id="fp_kpi_view_form" model="ir.ui.view">
<field name="name">fusion.plating.kpi.form</field>
<field name="model">fusion.plating.kpi</field>
<field name="arch" type="xml">
<form string="KPI Definition">
<sheet>
<div class="oe_title">
<h1>
<field name="name" placeholder="e.g. On-Time Delivery %"/>
</h1>
</div>
<group>
<group>
<field name="code"/>
<field name="kpi_type"/>
<field name="compute_method"/>
<field name="active"/>
</group>
<group>
<field name="target_value"/>
<field name="uom"/>
<field name="current_value"/>
<field name="trend"/>
<field name="facility_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<notebook>
<page string="Value History" name="history">
<field name="value_ids">
<list editable="bottom">
<field name="date"/>
<field name="value"/>
</list>
</field>
</page>
<page string="Trend Chart" name="chart">
<p class="text-muted">
Use the <strong>KPI History</strong> menu to view trend charts, or click the history count button above.
</p>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- ===== SEARCH VIEW ===== -->
<record id="fp_kpi_view_search" model="ir.ui.view">
<field name="name">fusion.plating.kpi.search</field>
<field name="model">fusion.plating.kpi</field>
<field name="arch" type="xml">
<search string="Search KPIs">
<field name="name"/>
<field name="code"/>
<field name="facility_id"/>
<separator/>
<filter string="On-Time Delivery" name="filter_otd"
domain="[('kpi_type', '=', 'otd')]"/>
<filter string="Dock-to-Dock" name="filter_d2d"
domain="[('kpi_type', '=', 'dock_to_dock')]"/>
<filter string="Throughput" name="filter_throughput"
domain="[('kpi_type', '=', 'throughput')]"/>
<filter string="Quality Yield" name="filter_quality"
domain="[('kpi_type', '=', 'quality_yield')]"/>
<filter string="Bath Uptime" name="filter_bath"
domain="[('kpi_type', '=', 'bath_uptime')]"/>
<filter string="Rework Events" name="filter_rework"
domain="[('kpi_type', '=', 'rework_count')]"/>
<filter string="Failed Specs" name="filter_failed_spec"
domain="[('kpi_type', '=', 'failed_spec_count')]"/>
<filter string="Processed Parts" name="filter_processed"
domain="[('kpi_type', '=', 'processed_parts')]"/>
<filter string="Shipped Parts" name="filter_shipped"
domain="[('kpi_type', '=', 'shipped_parts')]"/>
<filter string="Cost Per Part" name="filter_cost_per_part"
domain="[('kpi_type', '=', 'cost_per_part')]"/>
<filter string="Custom" name="filter_custom"
domain="[('kpi_type', '=', 'custom')]"/>
<separator/>
<filter string="Automatic" name="filter_auto"
domain="[('compute_method', '=', 'auto')]"/>
<filter string="Manual" name="filter_manual"
domain="[('compute_method', '=', 'manual')]"/>
<separator/>
<filter string="Archived" name="filter_archived"
domain="[('active', '=', False)]"/>
<group>
<filter string="Type" name="group_type"
context="{'group_by': 'kpi_type'}"/>
<filter string="Facility" name="group_facility"
context="{'group_by': 'facility_id'}"/>
</group>
</search>
</field>
</record>
<!-- ===== ACTION ===== -->
<record id="action_fp_kpi" model="ir.actions.act_window">
<field name="name">KPIs</field>
<field name="res_model">fusion.plating.kpi</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="fp_kpi_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Define your first KPI
</p>
<p>
Track on-time delivery, throughput, quality yield, and more.
</p>
</field>
</record>
</odoo>