Files
Odoo-Build/snippets/stock.report_bordero.basis57.xml
T

89 lines
4.6 KiB
XML

<?xml version="1.0"?>
<t t-name="stock.report_bordero.basis57">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<h2>Bordereau</h2>
<p>Lieferdatum: <span t-esc="context_timestamp(docs[0].scheduled_date).strftime('%Y-%m-%d')"/>
</p>
<table class="table table-sm">
<thead>
<tr>
<th>Kunde</th>
<th>Strasse</th>
<th>PLZ</th>
<th>Ort</th>
<th class="text-right">Gebinde</th>
<th class="text-right">Total Gewicht</th>
</tr>
</thead>
<tbody>
<t t-set="total_boxes" t-value="0"/>
<t t-set="total_weight" t-value="0"/>
<tr t-foreach="set([picking.partner_id for picking in docs.move_ids_without_package])" t-as="partner_id">
<t t-set="partner_moves" t-value="docs.move_ids_without_package.filtered(lambda x: x.partner_id == partner_id)"/>
<t t-set="count_boxes" t-value="sum(partner_moves.filtered(lambda m: m.product_id.x_storage_temperature &gt; -20).mapped('x_count_boxes'))"/>
<t t-set="count_cold_storage_boxes" t-value="sum(partner_moves.filtered(lambda m: m.product_id.x_storage_temperature &lt; -20).mapped('x_count_boxes'))"/>
<t t-set="boxes_weight" t-value="sum(partner_moves.mapped('weight'))"/>
<t t-set="total_boxes" t-value="total_boxes + count_boxes + count_cold_storage_boxes"/>
<t t-set="total_weight" t-value="total_weight + boxes_weight"/>
<td>
<span t-field="partner_id.name"/>
</td>
<td>
<span t-field="partner_id.street"/>
</td>
<td>
<span t-field="partner_id.zip"/>
</td>
<td>
<span t-field="partner_id.city"/>
</td>
<td class="text-right">
<t t-if="count_boxes &gt; 0">
<span><span t-esc="count_boxes"/> Frisch</span>
</t>
<t t-if="count_cold_storage_boxes &gt; 0">
<span><span t-esc="count_cold_storage_boxes"/> TK</span>
</t>
</td>
<td class="text-right">
<span t-esc="round(boxes_weight,2)"/>
<span> kg</span>
</td>
</tr>
</tbody>
</table>
<div class="clearfix">
<div id="total" class="row">
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ml-auto">
<table class="table table-sm" style="page-break-inside: avoid;">
<tr class="border-black o_total">
<td>
<strong>Total</strong>
</td>
<td class="text-right">
<span t-esc="total_boxes"/>
<span> Gebinde</span>
</td>
<td class="text-right">
<span t-esc="round(total_weight,2)"/>
<span> kg</span>
</td>
</tr>
</table>
</div>
</div>
</div>
<br/>
<t t-set="footer" t-value="docs.env['ir.translation'].search([('src', '=', 'stock.report_bordero.basis57.footer')], limit=1)"/>
<t t-if="footer">
<p>
<t t-raw="footer.value"/>
</p>
</t>
</div>
</t>
</t>
</t>