<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2018 Simone Rubino - Agile Business Group
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
    <record model="ir.ui.view" id="qc_inspection_form_view_picking">
        <field name="name">qc.inspection.form.view.picking</field>
        <field name="model">qc.inspection</field>
        <field name="inherit_id" ref="quality_control_oca.qc_inspection_form_view" />
        <field name="arch" type="xml">
            <field name="product_id" position="after">
                <field name="picking_id" />
                <field name="lot_id" groups="stock.group_production_lot" />
            </field>
        </field>
    </record>
    <record model="ir.ui.view" id="qc_inspection_tree_view_picking">
        <field name="name">qc.inspection.tree.view.picking</field>
        <field name="model">qc.inspection</field>
        <field name="inherit_id" ref="quality_control_oca.qc_inspection_tree_view" />
        <field name="arch" type="xml">
            <field name="product_id" position="after">
                <field name="picking_id" />
                <field name="lot_id" groups="stock.group_production_lot" />
            </field>
        </field>
    </record>
    <record model="ir.ui.view" id="qc_inspection_search_view_picking">
        <field name="name">qc.inspection.search.view.picking</field>
        <field name="model">qc.inspection</field>
        <field name="inherit_id" ref="quality_control_oca.qc_inspection_search_view" />
        <field name="arch" type="xml">
            <field name="product_id" position="after">
                <field name="picking_id" />
                <field name="lot_id" groups="stock.group_production_lot" />
            </field>
            <group expand="0" position="inside">
                <filter
                    string="Picking"
                    domain="[]"
                    name="group_by_picking_id"
                    context="{'group_by': 'picking_id'}"
                />
                <filter
                    string="Lot"
                    domain="[]"
                    name="group_by_lot_id"
                    groups="stock.group_production_lot"
                    context="{'group_by': 'lot_id'}"
                />
            </group>
        </field>
    </record>
    <record model="ir.ui.view" id="qc_inspection_line_tree_stock_view">
        <field name="name">qc.inspection.line.tree.stock</field>
        <field name="model">qc.inspection.line</field>
        <field
            name="inherit_id"
            ref="quality_control_oca.qc_inspection_line_tree_view"
        />
        <field name="arch" type="xml">
            <field name="product_id" position="after">
                <field name="picking_id" />
                <field name="lot_id" />
            </field>
        </field>
    </record>
    <record model="ir.ui.view" id="qc_inspection_line_search_stock_view">
        <field name="name">qc.inspection.line.search.stock</field>
        <field name="model">qc.inspection.line</field>
        <field
            name="inherit_id"
            ref="quality_control_oca.qc_inspection_line_search_view"
        />
        <field name="arch" type="xml">
            <field name="product_id" position="after">
                <field name="picking_id" />
                <field name="lot_id" />
            </field>
            <group expand="0" position="inside">
                <filter
                    string="Picking"
                    domain="[]"
                    name="group_by_picking_id"
                    context="{'group_by': 'picking_id'}"
                />
                <filter
                    string="Lot"
                    domain="[]"
                    name="group_by_lot_id"
                    context="{'group_by': 'lot_id'}"
                />
            </group>
        </field>
    </record>
</odoo>
