<?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>

    <!-- ************************************************************ -->
    <!-- MRP Bill of Materials - Form -->
    <!-- ************************************************************ -->

    <record id="view_mrp_bom_form" model="ir.ui.view">
        <field name="model">mrp.bom</field>
        <field name="inherit_id" ref="mrp.mrp_bom_form_view" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='code']" position="after">
                <field
                    name="bom_tag_ids"
                    widget="many2many_tags"
                    options="{'color_field': 'color'}"
                    context="{'display_complete_name': True}"
                />
            </xpath>
        </field>
    </record>

    <!-- ************************************************************ -->
    <!-- MRP Bill of Materials - Tree -->
    <!-- ************************************************************ -->

    <record id="view_mrp_bom_tree" model="ir.ui.view">
        <field name="model">mrp.bom</field>
        <field name="inherit_id" ref="mrp.mrp_bom_tree_view" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='product_id']" position="after">
                <field
                    name="bom_tag_ids"
                    widget="many2many_tags"
                    options="{'color_field': 'color'}"
                />
            </xpath>
        </field>
    </record>

    <!-- ************************************************************ -->
    <!-- MRP Bill of Materials - Search -->
    <!-- ************************************************************ -->

    <record id="view_mrp_bom_search" model="ir.ui.view">
        <field name="model">mrp.bom</field>
        <field name="inherit_id" ref="mrp.view_mrp_bom_filter" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='product_tmpl_id']" position="after">
                <field name="bom_tag_ids" />
            </xpath>
        </field>
    </record>

</odoo>
