<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

    <record model="ir.ui.view" id="stock_picking_form_view">
        <field
            name="name"
        >stock.picking.form (in stock_picking_commercial_partner)</field>
        <field name="model">stock.picking</field>
        <field name="inherit_id" ref="stock.view_picking_form" />
        <field name="arch" type="xml">
            <group name="other_infos" position="inside">
                <field name="commercial_partner_id" />
            </group>
        </field>
    </record>

    <record model="ir.ui.view" id="stock_picking_search_view">
        <field
            name="name"
        >stock.picking.search (in stock_picking_commercial_partner)</field>
        <field name="model">stock.picking</field>
        <field name="inherit_id" ref="stock.view_picking_internal_search" />
        <field name="arch" type="xml">
             <field name="partner_id" position="after">
                <field name="commercial_partner_id" />
            </field>
            <group position="inside">
                <filter
                    string="Commercial Entity"
                    name="groupby_commercial_partner_id"
                    domain="[]"
                    context="{'group_by': 'commercial_partner_id'}"
                />
            </group>
        </field>
    </record>

    <record model="ir.ui.view" id="stock_picking_tree_view">
        <field
            name="name"
        >stock.picking.tree (in stock_picking_commercial_partner)</field>
        <field name="model">stock.picking</field>
        <field name="inherit_id" ref="stock.vpicktree" />
        <field name="arch" type="xml">
            <field name="partner_id" position="after">
                <field name="commercial_partner_id" optional="hide" />
            </field>
        </field>
    </record>

</odoo>
