mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
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
45 lines
1.7 KiB
XML
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>
|