<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_picking_form" model="ir.ui.view">
        <field name="name">stock.picking.form</field>
        <field name="model">stock.picking</field>
        <field name="inherit_id" ref="stock.view_picking_form" />
        <field name="arch" type="xml">
            <field name="partner_id" position="after">
                <field name="assortment_product_ids" invisible="1" />
                <field name="has_assortment" invisible="1" />
            </field>
            <xpath
                expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']"
                position="attributes"
            >
                <attribute
                    name="domain"
                    operation="domain_add"
                    condition="parent.has_assortment"
                >
                    [('id', 'in', parent.assortment_product_ids)]
                </attribute>
            </xpath>
        </field>
    </record>

    <record id="view_stock_move_line_detailed_operation_tree" model="ir.ui.view">
        <field name="name">stock.move.line.operations.tree</field>
        <field name="model">stock.move.line</field>
        <field
            name="inherit_id"
            ref="stock.view_stock_move_line_detailed_operation_tree"
        />
        <field name="arch" type="xml">
            <xpath expr="//tree/field[@name='product_id']" position="attributes">
                <attribute
                    name="domain"
                    operation="domain_add"
                    condition="parent.has_assortment"
                >
                    [('id', 'in', parent.assortment_product_ids)]
                </attribute>
            </xpath>
        </field>
    </record>
</odoo>
