report_batch_picking.xml 5.21 KB
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <report string="Batch picking"
            id="action_report_batch_picking"
            model="stock.batch.picking"
            report_type="qweb-pdf"
            name="stock_batch_picking.report_batch_picking"
            file="stock_batch_picking.report_batch_picking"/>

    <template id="report_batch_picking">
        <t t-call="report.html_container">
            <t t-call="report.external_layout">
                <div class="page">
                    <div class="row mt32 mb32">
                        <div class="col-xs-3">
                            <strong>Date:</strong>
                            <span t-esc="formatLang(time.strftime('%Y-%m-%d'), date=True)"/>
                        </div>
                        <div class="col-xs-3">
                            <strong>Printed by:</strong>
                            <span t-field="user.name"/>
                        </div>
                    </div>
                    <t t-foreach="docs" t-as="doc">
                        <table class="table table-condensed">
                            <thead>
                                <tr>
                                    <th>Pickings Order</th>
                                    <th></th>
                                    <th>Picked By</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <span t-esc="doc.batch_name"/>
                                    </td>
                                    <td>Visa:_________________</td>
                                    <td>
                                        <span t-esc="doc.picker_id.name"/>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <br/>
                        <br/>
                        <p t-esc="batch_notes"/>
                        <br/>
                        <t t-foreach="get_location_datas(doc)" t-as="location_data">
                            <t t-set="locations" t-value="location_data[0]"/>
                            <t t-set="product_quantities" t-value="location_data[1]"/>

                            <table class="table table-condensed">
                                <caption>
                                    <b>
                                        <u>
                                            <span t-esc="locations[0]"/>
                                            &#x21E8;
                                            <span t-esc="locations[1]"/>
                                        </u>
                                    </b>
                                </caption>
                                <thead>
                                    <th>Product Code</th>
                                    <th>Product</th>
                                    <th>Carrier</th>
                                    <th class="text-right">QTY</th>
                                    <th>Explanation</th>
                                </thead>
                                <tbody>
                                    <t t-foreach="product_quantities" t-as="product_data">
                                        <t t-set="product" t-value="product_data[0]"/>
                                        <t t-set="qty" t-value="product_data[1]"/>
                                        <t t-set="carrier" t-value="product_data[2]"/>

                                        <tr>
                                            <td>
                                                <span t-field="product.default_code"/>
                                            </td>
                                            <td>
                                                <span t-field="product.name"/>
                                            </td>
                                            <td>
                                                <span t-esc="carrier"/>
                                            </td>
                                            <td class="text-right">
                                                <span t-esc="qty"/>
                                            </td>
                                            <td>stock error<br/>breakage
                                            </td>
                                            <tr align="left">
                                                <td colspan="4">
                                                    <pre class="description ">
                                                        <span t-esc="product.description_warehouse and product.description_warehouse or ''"></span>
                                                    </pre>
                                                </td>
                                            </tr>
                                        </tr>
                                    </t>
                                </tbody>
                            </table>
                        </t>
                    </t>
                </div>
            </t>
        </t>
    </template>
</odoo>