<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_stock_barcode_selection_printing" model="ir.ui.view">
        <field name="name">stock.barcode.selection.printing.form</field>
        <field name="model">stock.picking.print</field>
        <field name="arch" type="xml">
            <form>
                <p>You can print just the products with assigned barcode</p>
                <field name="picking_ids" invisible="1" force_save="1" />
                <div>
                    <strong>Barcode Report</strong>
                    <br />
                    <field name="barcode_report" />
                </div>
                <div attrs="{'invisible': [('is_custom_label', '=', True)]}">
                    <strong>Barcode Format</strong>
                    <br />
                    <field name="barcode_format" />
                </div>
                <div>
                    <strong>Language</strong>
                    <br />
                    <field name="lang" />
                </div>
                <p
                    attrs="{'invisible': [('is_custom_label', '=', True)]}"
                >It only appears here products with barcode defined</p>
                <div attrs="{'invisible': [('is_custom_label', '=', False)]}">
                    <field name="is_custom_label" invisible="1" />
                    <strong>Label Quantity</strong>
                    <br />
                    <field name="label_qty" />
                    <br />
                    <field
                        name="html_content"
                        nolabel="1"
                        placeholder="Fill info of label..."
                    />
                </div>
                <group attrs="{'invisible': [('is_custom_label', '=', True)]}">
                    <field name="product_print_moves" nolabel="1" colspan="2">
                        <tree editable="top" create="0">
                            <field
                                name="product_id"
                                options="{'no_create': True, 'no_open': True}"
                                force_save="1"
                                readonly="1"
                            />
                            <field
                                name="lot_id"
                                force_save="1"
                                readonly="1"
                                groups="stock.group_production_lot"
                            />
                            <field
                                name="result_package_id"
                                force_save="1"
                                readonly="1"
                                groups="stock.group_tracking_lot"
                            />
                            <field name="quantity" />
                            <field
                                name="uom_id"
                                force_save="1"
                                readonly="1"
                                groups="uom.group_uom"
                            />
                            <field
                                name="product_packaging_id"
                                options="{'no_create': True}"
                            />
                            <field name="label_qty" />
                            <field name="move_line_id" invisible="1" force_save="1" />
                        </tree>
                    </field>
                </group>
                <footer>
                    <button
                        name="print_labels"
                        string="Print"
                        type="object"
                        class="btn-primary"
                    />
                    <button string="Cancel" class="btn-secondary" special="cancel" />
                </footer>
            </form>
        </field>
    </record>
    <record id="act_stock_barcode_selection_printing" model="ir.actions.act_window">
        <field name="name">Print barcode labels</field>
        <field name="res_model">stock.picking.print</field>
        <field name="view_mode">form</field>
        <field name="binding_type">report</field>
        <field name="binding_model_id" ref="stock.model_stock_picking" />
        <field name="target">new</field>
    </record>
    <record id="act_stock_barcode_selection_printing_sml" model="ir.actions.act_window">
        <field name="name">Print barcode labels</field>
        <field name="res_model">stock.picking.print</field>
        <field name="view_mode">form</field>
        <field name="binding_type">report</field>
        <field name="binding_model_id" ref="stock.model_stock_move_line" />
        <field name="target">new</field>
    </record>
    <record
        id="act_stock_barcode_selection_printing_quant"
        model="ir.actions.act_window"
    >
        <field name="name">Print barcode labels</field>
        <field name="res_model">stock.picking.print</field>
        <field name="view_mode">form</field>
        <field name="binding_type">report</field>
        <field name="binding_model_id" ref="stock.model_stock_quant" />
        <field name="target">new</field>
    </record>
    <record id="act_stock_barcode_selection_printing_lot" model="ir.actions.act_window">
        <field name="name">Print barcode labels</field>
        <field name="res_model">stock.picking.print</field>
        <field name="view_mode">form</field>
        <field name="binding_type">report</field>
        <field name="binding_model_id" ref="stock.model_stock_lot" />
        <field name="target">new</field>
    </record>
</odoo>
