<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2022 - Today: GRAP (http://www.grap.coop)
@author: Quentin DUPONT (quentin.dupont@grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

    <record id="view_product_template_form" model="ir.ui.view">
        <field name="model">product.template</field>
        <field name="inherit_id" ref="product.product_template_form_view" />
        <field name="arch" type="xml">

            <xpath expr="//field[@name='purchase_ok']/.." position="after">
                <span class="d-inline-block" groups="base.group_no_one">
                    <field name="is_component" />
                    <label for="is_component" />
                </span>
                <span class="d-inline-block" groups="base.group_no_one">
                    <field name="is_intermediate" />
                    <label for="is_intermediate" />
                </span>
            </xpath>

        </field>
    </record>

    <record id="view_mrp_product_template_search" model="ir.ui.view">
        <field name="model">product.template</field>
        <field name="inherit_id" ref="mrp.mrp_product_template_search_view" />
        <field name="arch" type="xml">
            <xpath expr="//filter[@name='manufactured_products']" position="after">
              <filter
                    string="Intermediates Products"
                    name="filter_is_intermediate"
                    domain="[('is_intermediate', '=', True)]"
                    groups="mrp.group_mrp_user"
                />
            </xpath>
            <xpath expr="//filter[@name='filter_is_intermediate']" position="after">
              <filter
                    string="Components Products"
                    name="filter_is_component"
                    domain="[('is_component', '=', True)]"
                    groups="mrp.group_mrp_user"
                />
            </xpath>
            <xpath expr="//filter[@name='components']" position="attributes">
              <attribute name="invisible">1</attribute>
            </xpath>
        </field>
    </record>

</odoo>
