[add] compact ekg delivery slips

This commit is contained in:
NIels Göttsch 2024-05-07 22:35:58 +02:00
parent a7308a8792
commit 629e443f8f
3 changed files with 82 additions and 1 deletions

View file

@ -6,7 +6,7 @@
"category": "Stock",
"version": "16.0.1.0.1",
"depends": ["stock"],
"data": ["views/report_deliveryslip.xml", "report/stock_report_views.xml"],
"data": ["views/report_deliveryslip.xml", "views/report_deliveryslip_compact.xml", "report/stock_report_views.xml"],
"assets": {"web.report_assets_common": ["nfu_ekg_stock/static/src/scss/report_stock_rule.scss"]},
"license": "LGPL-3",
"application": True,

View file

@ -12,4 +12,18 @@
<field name="binding_model_id" ref="stock.model_stock_picking"/>
<field name="binding_type">report</field>
</record>
<record id="action_report_ekg_delivery_compact" model="ir.actions.report">
<field name="name">EKG Delivery Slip Compact</field>
<field name="model">stock.picking</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">nfu_ekg_stock.report_ekg_deliveryslip_compact</field>
<field name="report_file">nfu_ekg_stock.report_ekg_deliveryslip_compact</field>
<field
name="print_report_name"
>'EKG Delivery Slip Compact - %s - %s' % (object.partner_id.name or '', object.name)</field>
<field name="binding_model_id" ref="stock.model_stock_picking"/>
<field name="binding_type">report</field>
</record>
</odoo>

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="report_ekg_delivery_compact_document">
<t t-set="o" t-value="o.with_context(lang=o._get_report_lang())"/>
<t t-set="partner" t-value="o.partner_id or (o.move_ids and o.move_ids[0].partner_id) or False"/>
<div style="page-break-inside: avoid;">
<table class="table table-sm table-bordered" t-if="o.state!='done'" name="stock_move_table">
<thead>
<tr>
<th name="th_sm_name"><span t-field="partner.name"/></th>
<th name="th_sm_quantity" style="white-space: nowrap; width: 10%"><strong>Qty</strong></th>
</tr>
</thead>
<tbody>
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/>
<tr t-foreach="lines" t-as="move">
<td>
<span t-field="move.product_id.name"/>
</td>
<td style="white-space: nowrap;">
<span t-field="move.quantity_done"/>
(<span t-field="move.product_uom_qty"/>)
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered" t-if="o.move_line_ids and o.state=='done'"
name="stock_move_line_table">
<thead>
<tr>
<th name="th_sm_name"><span t-field="partner.name"/></th>
<th name="th_sm_quantity" style="white-space: nowrap; width: 10%"><strong>Qty</strong></th>
</tr>
</thead>
<tbody>
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/>
<tr t-foreach="lines" t-as="move">
<td>
<span t-field="move.product_id.name"/>
</td>
<td style="white-space: nowrap;">
<span t-field="move.quantity_done"/>
(<span t-field="move.product_uom_qty"/>)
</td>
</tr>
</tbody>
</table>
</div>
</template>
<template id="report_ekg_deliveryslip_compact">
<t t-call="web.html_container">
<t t-call="web.basic_layout">
<div class="row">
<t t-foreach="docs" t-as="o">
<div class="col-6">
<t t-call="nfu_ekg_stock.report_ekg_delivery_compact_document" t-lang="o._get_report_lang()"/>
</div>
</t>
</div>
</t>
</t>
</template>
</odoo>