<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018 Tecnativa - Carlos Dauden
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
    <!-- Stock Batch Picking - Print Picking Operations -->
    <record id="action_print_batch_picking_operations" model="ir.actions.server">
        <field name="name">Print Picking Operations</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="state">code</field>
        <field
            name="code"
        >pickings = records.mapped('picking_ids').filtered(lambda p: p.state != 'cancel')
action = env.ref('stock.action_report_picking').report_action(pickings)
        </field>
    </record>
    <!-- Stock Batch Picking - Print Delivery Slip -->
    <record id="action_print_batch_delivery_slip" model="ir.actions.server">
        <field name="name">Print Delivery Slip</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="state">code</field>
        <field
            name="code"
        >pickings = records.mapped('picking_ids').filtered(lambda p: p.state != 'cancel')
action = env.ref('stock.action_report_delivery').report_action(pickings)
        </field>
    </record>
    <record model="ir.actions.server" id="action_stock_batch_picking_assign_all">
        <field name="name">Reserve All</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="state">code</field>
        <field name="code">
for record in records:
    record.action_assign()
        </field>
    </record>
</odoo>
