Merge PR #1833 into 16.0

Signed-off-by yajo
This commit is contained in:
OCA-git-bot
2023-09-11 06:40:04 +00:00
3 changed files with 50 additions and 2 deletions

View File

@@ -8,7 +8,11 @@
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",
"depends": ["stock"],
"data": ["views/stock_picking_form_view.xml", "views/stock_move_tree_view.xml"],
"data": [
"views/report_stock_picking.xml",
"views/stock_move_tree_view.xml",
"views/stock_picking_form_view.xml",
],
"license": "LGPL-3",
"installable": True,
"maintainers": ["yajo"],

View File

@@ -1 +1 @@
Add packaging fields in the stock moves
Add packaging fields in the stock moves and their reports.

View File

@@ -0,0 +1,44 @@
<?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>