[add] Lastname first reports
This commit is contained in:
parent
0fb12905ea
commit
2e10b1d1ba
3 changed files with 91 additions and 28 deletions
|
|
@ -13,6 +13,7 @@
|
|||
<field name="margin_right">5</field>
|
||||
<field name="dpi">90</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_ekg_packing_list" model="ir.actions.report">
|
||||
<field name="name">EKG Packing List</field>
|
||||
<field name="model">stock.picking</field>
|
||||
|
|
@ -27,6 +28,20 @@
|
|||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_ekg_packing_list_lf" model="ir.actions.report">
|
||||
<field name="name">EKG Packing List LF</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="paperformat_id" ref="paperformat_packaging_list"/>
|
||||
<field name="report_name">nfu_ekg_stock.report_ekg_packing_list_lf</field>
|
||||
<field name="report_file">nfu_ekg_stock.report_packing_list</field>
|
||||
<field
|
||||
name="print_report_name"
|
||||
>'EKG Packing List - %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>
|
||||
|
||||
<record id="action_report_ekg_delivery" model="ir.actions.report">
|
||||
<field name="name">EKG Delivery Slip</field>
|
||||
<field name="model">stock.picking</field>
|
||||
|
|
@ -35,7 +50,20 @@
|
|||
<field name="report_file">nfu_ekg_stock.report_deliveryslip</field>
|
||||
<field
|
||||
name="print_report_name"
|
||||
>'EKG Delivery Slip - %s - %s' % (object.partner_id.name or '', object.name)</field>
|
||||
>'EKG Delivery Slip - %s, %s - %s' % (object.partner_id.lastname or '',object.partner_id.firstname or '', object.name)</field>
|
||||
<field name="binding_model_id" ref="stock.model_stock_picking"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_ekg_delivery_lf" model="ir.actions.report">
|
||||
<field name="name">EKG Delivery Slip LF</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">nfu_ekg_stock.report_ekg_deliveryslip_lf</field>
|
||||
<field name="report_file">nfu_ekg_stock.report_deliveryslip</field>
|
||||
<field
|
||||
name="print_report_name"
|
||||
>'EKG Delivery Slip - %s, %s - %s' % (object.partner_id.lastname or '',object.partner_id.firstname or '', object.name)</field>
|
||||
<field name="binding_model_id" ref="stock.model_stock_picking"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,12 @@
|
|||
<div class="page" style="page-break-inside: avoid;">
|
||||
<div class="row mt16">
|
||||
<div class="col-auto" name="div_name" t-if="partner">
|
||||
<strong><span t-field="partner.name"/></strong>
|
||||
<t t-if="last_first">
|
||||
<strong><span t-field="partner.lastname"/>, <span t-field="partner.firstname"/></strong>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<strong><span t-field="partner.name"/></strong>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-sm" name="stock_move_table" style="font-size: smaller">
|
||||
|
|
@ -67,4 +72,16 @@
|
|||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="report_ekg_deliveryslip_lf">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.basic_layout">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-set="last_first" t-value="True"/>
|
||||
<t t-call="nfu_ekg_stock.report_ekg_delivery_document" t-lang="o._get_report_lang()"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<template id="report_ekg_packing_list">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.basic_layout">
|
||||
<t t-set="partners" t-value="docs.mapped('partner_id')"/>
|
||||
<t
|
||||
t-set="lines"
|
||||
t-value="docs.filtered(lambda p:p.partner_id).mapped('move_ids').filtered(lambda x: x.product_uom_qty)"
|
||||
/>
|
||||
<t t-set="products" t-value="lines.mapped('product_id')"/>
|
||||
<t t-set="pagination" t-value="9"/>
|
||||
<t
|
||||
t-set="partner_chunks"
|
||||
t-value="[partners[i:i+pagination] for i in range(0, len(partners), pagination)]"
|
||||
/>
|
||||
<t t-foreach="partner_chunks" t-as="partner_chunk">
|
||||
<div style="page-break-inside: avoid;">
|
||||
<template id="report_ekg_packing_document">
|
||||
<t t-set="partners" t-value="docs.mapped('partner_id')"/>
|
||||
<t
|
||||
t-set="lines"
|
||||
t-value="docs.filtered(lambda p:p.partner_id).mapped('move_ids').filtered(lambda x: x.product_uom_qty)"
|
||||
/>
|
||||
<t t-set="products" t-value="lines.mapped('product_id')"/>
|
||||
<t t-set="pagination" t-value="9"/>
|
||||
<t t-set="partner_chunks" t-value="[partners[i:i+pagination] for i in range(0, len(partners), pagination)]"/>
|
||||
<t t-foreach="partner_chunks" t-as="partner_chunk">
|
||||
<div style="page-break-inside: avoid;">
|
||||
<table class="table table-bordered table-sm w-auto border-dark" name="nfu_ekg_packing_list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -23,10 +18,18 @@
|
|||
<th class="code align-top text-truncate">Internal<br/>Reference</th>
|
||||
<th class="packaging align-top text-truncate">Batch<br/>Size</th>
|
||||
<t t-foreach="partner_chunk" t-as="partner">
|
||||
<th class="partner align-top"><div class="text-truncate">
|
||||
<t t-esc="partner.lastname"/><br/>
|
||||
<t t-esc="partner.firstname"/>
|
||||
</div></th>
|
||||
<th class="partner align-top">
|
||||
<div class="text-truncate">
|
||||
<t t-if="last_first">
|
||||
<t t-esc="partner.lastname"/>,<br/>
|
||||
<t t-esc="partner.firstname"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<t t-esc="partner.firstname"/><br/>
|
||||
<t t-esc="partner.lastname"/>
|
||||
</t>
|
||||
</div>
|
||||
</th>
|
||||
</t>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -42,18 +45,33 @@
|
|||
<t t-foreach="partner_chunk" t-as="partner">
|
||||
<td>
|
||||
<t
|
||||
t-set="qty"
|
||||
t-value="sum(lines.filtered(lambda p:p.picking_id.partner_id.id == partner.id).filtered(lambda p:p.product_id.id == product.id).mapped('product_uom_qty'))"
|
||||
/>
|
||||
t-set="qty"
|
||||
t-value="sum(lines.filtered(lambda p:p.picking_id.partner_id.id == partner.id).filtered(lambda p:p.product_id.id == product.id).mapped('product_uom_qty'))"
|
||||
/>
|
||||
<t t-if="qty" t-esc="qty"/>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
</t>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
||||
<template id="report_ekg_packing_list">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.basic_layout">
|
||||
<t t-call="nfu_ekg_stock.report_ekg_packing_document"/>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="report_ekg_packing_list_lf">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.basic_layout">
|
||||
<t t-set="last_first" t-value="True"/>
|
||||
<t t-call="nfu_ekg_stock.report_ekg_packing_document"/>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in a new issue