<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2024 Moduon Team S.L.
     License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>

    <record
        id="stock_picking_batch_form_inherit_stock_picking_batch_print_pickings"
        model="ir.ui.view"
    >
        <field name="name">Picking Batch Print Pickings</field>
        <field name="model">stock.picking.batch</field>
        <field name="inherit_id" ref="stock_picking_batch.stock_picking_batch_form" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='show_lots_text']" position="after">
                <field name="print_documents" invisible="1" />
            </xpath>
            <xpath expr="//header" position="inside">
                <button
                    string="Delivery Slips"
                    name="action_print_pickings"
                    type="object"
                    attrs="{'invisible': [('print_documents', '=', False)]}"
                />
            </xpath>
        </field>
    </record>
    <record id="action_print_pickings" model="ir.actions.server">
        <field name="name">Delivery Slips</field>
        <field name="model_id" ref="stock_picking_batch.model_stock_picking_batch" />
        <field
            name="binding_model_id"
            ref="stock_picking_batch.model_stock_picking_batch"
        />
        <field name="binding_view_types">list</field>
        <field name="state">code</field>
        <field name="code">
if records:
    action = records.action_print_pickings()</field>
    </record>
</odoo>
