Skip to content
Snippets Groups Projects
Commit 4451d36f authored by Touati Djamel (otd)'s avatar Touati Djamel (otd)
Browse files

[FIX] stock: print all barcodes when picking qty done is at 0


Steps to reproduce the bug:
- Go to Inventory > Transfers > Select a ready transfer with no qty done
- Print > barcodes (ZPL) or barcodes (PDF)

Problem:
The file is empty because there is no qty_done.

Solution:
If no qty is done, then print all barcodes as if picking is done.
It makes sense, for example, when a user wants to print the barcodes before the product is delivered

but if at least one move_line has a Qty_done then do not print the other move_lines which have a qty_done of 0

opw-2780365

closes odoo/odoo#86756

X-original-commit: f6ae75f2
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
Signed-off-by: default avatarDjamel Touati (otd) <otd@odoo.com>
parent d2e0b482
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,16 @@
<t t-set="uom_categ_unit" t-value="env.ref('uom.product_uom_categ_unit')"/>
<t t-foreach="docs" t-as="picking">
<t t-set="picking_qty_done" t-value="any(picking.move_lines.move_line_ids.mapped('qty_done'))"/>
<t t-foreach="picking.move_lines" t-as="move">
<t t-foreach="move.move_line_ids" t-as="move_line">
<t t-if="move_line.product_uom_id.category_id == uom_categ_unit">
<t t-set="qty" t-value="int(move_line.qty_done)"/>
<t t-if="picking_qty_done">
<t t-set="qty" t-value="int(move_line.qty_done)"/>
</t>
<t t-else="">
<t t-set="qty" t-value="int(move_line.product_uom_qty)"/>
</t>
</t>
<t t-else="">
<t t-set="qty" t-value="1"/>
......@@ -42,10 +48,16 @@
<div class="page">
<t t-set="uom_categ_unit" t-value="env.ref('uom.product_uom_categ_unit')"/>
<t t-foreach="docs" t-as="picking">
<t t-set="picking_qty_done" t-value="any(picking.move_lines.move_line_ids.mapped('qty_done'))"/>
<t t-foreach="picking.move_lines" t-as="move">
<t t-foreach="move.move_line_ids" t-as="move_line">
<t t-if="move_line.product_uom_id.category_id == uom_categ_unit">
<t t-set="qty" t-value="int(move_line.qty_done)"/>
<t t-if="picking_qty_done">
<t t-set="qty" t-value="int(move_line.qty_done)"/>
</t>
<t t-else="">
<t t-set="qty" t-value="int(move_line.product_uom_qty)"/>
</t>
</t>
<t t-else="">
<t t-set="qty" t-value="1"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment