Files
stock-logistics-warehouse/stock_move_packaging_qty/views/report_stock_picking.xml
Jairo Llopis ad633c12d6 [IMP] stock_move_packaging_qty: display in PDF reports
Directly display qty on delivery slip.

In the case of picking operations report, compute the qty based on the
one found in the `stock.move.line` and the `product.packaging` ratio.

@moduon MT-3774
2023-09-08 11:03:45 +01:00

45 lines
1.7 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 Moduon Team S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<data>
<template id="report_picking" inherit_id="stock.report_picking">
<xpath expr="//span[@t-field='ml.product_uom_id']" position="after">
<div
t-if="ml.move_id.product_packaging_id"
class="text-secondary"
groups="product.group_stock_packaging"
>
<t
t-set="ml_packaging_qty"
t-value="(ml.qty_done if o.state == 'done' else ml.reserved_uom_qty) / ml.move_id.product_packaging_id.qty"
/>
<span t-field="ml.move_id.product_packaging_id" />:
<span t-out="ml_packaging_qty" />
</div>
</xpath>
</template>
<template id="report_delivery_document" inherit_id="stock.report_delivery_document">
<!-- DOCS https://github.com/orgs/OCA/discussions/111 -->
<xpath
expr="//table[@name='stock_move_table']/tbody//td[
1 + count(
//table[@name='stock_move_table']
//th[@name='th_sm_ordered']
/preceding-sibling::*
)
]"
position="inside"
>
<div
t-if="move.product_packaging_id"
class="text-secondary"
groups="product.group_stock_packaging"
>
<span t-field="move.product_packaging_id" />:
<span t-field="move.product_packaging_qty" />
</div>
</xpath>
</template>
</data>