<!-- Copyright 2021 Patrick Wilson <patrickraymondwilson@gmail.com>
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).-->
<odoo>
    <record id="sale_order_tag_view_list" model="ir.ui.view">
        <field name="name">sale.order.tag.list</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.sale_order_tree" />
        <field name="type">list</field>
        <field name="arch" type="xml">
            <field name="partner_id" position="before">
                <field name="so_tag_ids" widget="many2many_tags" />
            </field>
        </field>
    </record>
    <record id="sale_order_tag_view_form" model="ir.ui.view">
        <field name="name">sale.order.tag.form</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form" />
        <field name="type">form</field>
        <field name="arch" type="xml">
            <field name="payment_term_id" position="before">
                <field
                    name="so_tag_ids"
                    placeholder="tag..."
                    widget="many2many_tags"
                    options="{'color_field': 'color', 'no_create': True, 'no_create_edit': True}"
                    domain="['|',('team_ids', 'in', team_id), ('team_ids', '=', False)]"
                />
            </field>
        </field>
    </record>
    <record id="sale_order_tag_view_filter" model="ir.ui.view">
        <field name="name">sale.order.tag.search</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_sales_order_filter" />
        <field name="arch" type="xml">
            <field name='order_line' position="after">
                <field name="so_tag_ids" />
            </field>
        </field>
    </record>
</odoo>
