<?xml version="1.0" encoding="utf-8" ?>
<!--
  Copyright 2016-2022 Akretion France (https://akretion.com/)
  @author: Alexis de Lattre <alexis.delattre@akretion.com>
  License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
    <record id="purchase_order_form" model="ir.ui.view">
        <field name="name">commercial.partner.purchase.order.form</field>
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_form" />
        <field name="arch" type="xml">
            <field name="partner_id" position="before">
                <field name="commercial_partner_id" invisible="1" />
            </field>
        </field>
    </record>
    <record id="view_purchase_order_filter" model="ir.ui.view">
        <field name="name">commercial.partner.purchase.order.search</field>
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.view_purchase_order_filter" />
        <field name="arch" type="xml">
            <filter name="vendor" position="before">
                <filter
                    name="commercial_partner_groupby"
                    string="Commercial Vendor"
                    context="{'group_by': 'commercial_partner_id'}"
                />
            </filter>
        </field>
    </record>
    <record id="purchase_order_view_search" model="ir.ui.view">
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_view_search" />
        <field name="arch" type="xml">
            <filter name="vendor" position="before">
                <filter
                    name="commercial_partner_groupby"
                    string="Commercial Vendor"
                    context="{'group_by': 'commercial_partner_id'}"
                />
            </filter>
        </field>
    </record>
</odoo>
