74 lines
4.7 KiB
XML
74 lines
4.7 KiB
XML
<data inherit_id="stock.report_picking" priority="50">
|
|
<xpath expr="//div[hasclass('page')]" position="before">
|
|
<!-- Get all lines without duplicates -->
|
|
<t t-set="dates" t-value="list(set([d.date() for d in o.move_ids_without_package.mapped('date')]))"/>
|
|
<!-- Store if has dates -->
|
|
<t t-set="has_dates" t-value="len(dates) > 0"/>
|
|
<!-- Store if has multiple dates -->
|
|
<t t-set="has_multiple_dates" t-value="len(dates) > 1"/>
|
|
</xpath>
|
|
<!-- Replace loop -->
|
|
<xpath expr="//tbody[1]/t" position="replace">
|
|
<!--<p t-esc="dates" />-->
|
|
<!--<p t-esc="has_dates" />-->
|
|
<!--<p t-esc="has_multiple_dates" />-->
|
|
<!-- Loop each group item -->
|
|
<t t-foreach="dates" t-as="date">
|
|
<!-- Insert group item -->
|
|
<tr t-if="has_dates and date" class="o_line_note">
|
|
<td colspan="99" style="padding-top: 1rem;">
|
|
<strong>
|
|
<span>Lieferdatum: </span>
|
|
<span t-esc="date" t-options="{'widget': 'date'}"/>
|
|
</strong>
|
|
</td>
|
|
</tr>
|
|
<!-- Show only move that are assigned to the group item -->
|
|
<t t-set="move_ids" t-value="o.move_ids_without_package.filtered(lambda m: m.date.strftime('%Y-%m-%d') == date.strftime('%Y-%m-%d')).sorted(lambda m: m.date)"/>
|
|
<t t-foreach="move_ids" t-as="move">
|
|
<t t-foreach="move.move_line_ids.sorted(key=lambda ml: ml.location_id.id)" t-as="ml">
|
|
<tr>
|
|
<td id="description_picking">
|
|
<span t-field="ml.product_id.display_name"/>
|
|
<br/>
|
|
<span t-field="ml.product_id.description_picking"/>
|
|
</td>
|
|
<td id="product_uom_qty">
|
|
<span t-if="o.state != 'done'" t-field="ml.reserved_uom_qty"/>
|
|
<span t-if="o.state == 'done'" t-field="ml.qty_done"/>
|
|
<span t-field="ml.product_uom_id" groups="uom.group_uom"/>
|
|
</td>
|
|
<td id="location_id" t-if="o.picking_type_id.code != 'incoming'" groups="stock.group_stock_multi_locations">
|
|
<span t-esc="ml.location_id.display_name"/>
|
|
<t t-if="ml.package_id">
|
|
<span t-field="ml.package_id"/>
|
|
</t>
|
|
</td>
|
|
<td id="location_dest_id" t-if="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">
|
|
<div>
|
|
<span t-field="ml.location_dest_id"/>
|
|
<t t-if="ml.result_package_id">
|
|
<span t-field="ml.result_package_id"/>
|
|
</t>
|
|
</div>
|
|
</td>
|
|
<td id="has_serial_number" class=" text-center h6" t-if="has_serial_number">
|
|
<img t-if="has_serial_number and (ml.lot_id or ml.lot_name)" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&humanreadable=1' % ('Code128', ml.lot_id.name or ml.lot_name, 400, 100)" style="width:100%;height:35px;" alt="Barcode"/>
|
|
</td>
|
|
<td id="barcode" class="text-center" t-if="has_barcode">
|
|
<t t-if="product_barcode != move.product_id.barcode">
|
|
<span t-if="move.product_id and move.product_id.barcode">
|
|
<img t-if="len(move.product_id.barcode) == 13" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&quiet=%s' % ('EAN13', move.product_id.barcode, 400, 100, 0)" style="height:35px" alt="Barcode"/>
|
|
<img t-elif="len(move.product_id.barcode) == 8" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&quiet=%s' % ('EAN8', move.product_id.barcode, 400, 100, 0)" style="height:35px" alt="Barcode"/>
|
|
<img t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&quiet=%s' % ('Code128', move.product_id.barcode, 400, 100, 0)" style="height:35px" alt="Barcode"/>
|
|
</span>
|
|
<t t-set="product_barcode" t-value="move.product_id.barcode"/>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</xpath>
|
|
</data>
|