<?xml version="1.0" encoding="utf-8" ?>
<odoo>

    <template
        id="mrp_order_report_product_barcode"
        inherit_id="mrp.report_mrp_production_components"
    >
        <xpath expr="//table/t[@t-set='has_product_barcode']" position="after">
            <t
                t-set="has_lot_barcode"
                t-value="any(m.lot_id.name for m in o.move_raw_ids.move_line_ids)"
            />
        </xpath>
        <xpath expr="//table/thead/tr/th[@class='text-center']" position="after">
            <th t-if="has_lot_barcode" class="text-center" width="15%"><strong
                >Lot Barcode</strong></th>
        </xpath>
        <xpath expr="//table/tbody/tr/td[@class='text-center']" position="after">
            <td class="text-center">
                <t t-foreach="raw_line.move_line_ids" t-as="line">
                    <t t-if="line.lot_id.name">
                        <div
                            t-field="line.lot_id.name"
                            t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:100%;height:35px'}"
                        />
                        <div t-field="line.lot_id.name" />
                        <br />
                    </t>
                </t>
            </td>
        </xpath>
    </template>

</odoo>
