<?xml version="1.0" encoding="utf-8" ?>
<odoo>

        <!-- Management System Non Conformity Report Pivot View -->
        <record id="view_report_mgmtsystem_nonconformity_pivot" model="ir.ui.view">
            <field name="name">mgmtsystem.nonconformity.report.pivot</field>
            <field name="model">mgmtsystem.nonconformity</field>
            <field name="arch" type="xml">
                <pivot string="Non conformity" disable_linking="True">
                    <field name="state" type="row" />
                    <field name="user_id" type="col" />
                    <field name="number_of_nonconformities" type="measure" />
                </pivot>
            </field>
        </record>

        <!-- Non Conformity Report Graph View -->
        <record id="view_report_mgmtsystem_nonconformity_graph" model="ir.ui.view">
            <field name="name">mgmtsystem.nonconformity.report.graph</field>
            <field name="model">mgmtsystem.nonconformity</field>
            <field name="arch" type="xml">
                <graph string="Non conformity">
                    <field name="state" />
                    <field name="user_id" />
                    <field name="number_of_nonconformities" type="measure" />
                </graph>
            </field>
        </record>

        <!-- Management system Non Conformity Report Action -->
        <record
        id="action_report_mgmtsystem_nonconformity"
        model="ir.actions.act_window"
    >
            <field name="name">Management System Analysis</field>
            <field name="res_model">mgmtsystem.nonconformity</field>
            <field name="view_mode">pivot,graph</field>
            <field name="view_id" />
            <!-- force empty -->
            <field
            name="help"
        >Have a general overview of all non conformities processed in the system by sorting them with specific criteria.</field>
        </record>

        <menuitem
        name="Nonconformities"
        id="menu_report_mgmtsystem_nonconformity_tree"
        action="action_report_mgmtsystem_nonconformity"
        parent="mgmtsystem.menu_mgmtsystem_report"
        sequence="15"
    />

</odoo>
