<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright (C) 2022 Akretion (<http://www.akretion.com>).
     @author Kévin Roche <kevin.roche@akretion.com>
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="view_template_route_profile_form" model="ir.ui.view">
        <field name="name">product.template.route.profile.form</field>
        <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='route_ids']/parent::div" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <xpath expr="//field[@name='route_ids']" position="attributes">
                <attribute name="readonly">1</attribute>
            </xpath>
            <xpath expr="//label[@for='route_ids']" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
            <xpath expr="//group[@name='operations']" position="inside">
                <field
                    name="route_profile_id"
                    attrs="{'invisible': [('type', 'not in', ['product', 'consu'])]}"
                />
                <field
                    name="force_route_profile_id"
                    attrs="{'invisible': [('type', 'not in', ['product', 'consu'])]}"
                />
            </xpath>
        </field>
    </record>
</odoo>
