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

    <!-- Origin -->

    <record id="view_mgmtsystem_nonconformity_origin_form" model="ir.ui.view">
      <field name="name">mgmtsystem.nonconformity.origin.form</field>
      <field name="type">form</field>
      <field name="model">mgmtsystem.nonconformity.origin</field>
      <field name="arch" type="xml">
        <form string="Origins of nonconformity">
          <sheet>
            <field name="active" invisible="1" />
            <widget
                        name="web_ribbon"
                        title="Archived"
                        bg_color="bg-danger"
                        attrs="{'invisible': [('active', '=', True)]}"
                    />
            <group>
              <field name="name" />
              <field name="sequence" />
              <field name="parent_id" />
              <field name="ref_code" />
              <field name="description" />
            </group>
          </sheet>
        </form>
      </field>
    </record>

    <record id="view_mgmtsystem_nonconformity_origin_tree" model="ir.ui.view">
      <field name="name">mgmtsystem.nonconformity.origin.tree</field>
      <field name="model">mgmtsystem.nonconformity.origin</field>
      <field name="type">tree</field>
      <field name="arch" type="xml">
        <tree>
          <field name="parent_id" />
          <field name="name" />
          <field name="description" />
          <field name="sequence" />
        </tree>
      </field>
    </record>

    <record id="view_mgmtsystem_nonconformity_origin_filter" model="ir.ui.view">
      <field name="name">Origins</field>
      <field name="model">mgmtsystem.nonconformity.origin</field>
      <field name="arch" type="xml">
        <search string="Origins">
          <field name="parent_id" />
          <field name="name" />
        </search>
      </field>
    </record>

    <record
        id="open_mgmtsystem_nonconformity_origin_list"
        model="ir.actions.act_window"
    >
      <field name="name">Origins</field>
      <field name="res_model">mgmtsystem.nonconformity.origin</field>
      <field name="view_mode">tree,form</field>
      <field name="view_id" eval="False" />
      <field name="search_view_id" ref="view_mgmtsystem_nonconformity_origin_filter" />
    </record>

    <menuitem
        id="menu_open_nonconformity_origin"
        action="open_mgmtsystem_nonconformity_origin_list"
        parent="menu_mgmtsystem_configuration_nonconformities"
        sequence="20"
        groups="mgmtsystem.group_mgmtsystem_manager"
    />

</odoo>
