From 944f959e74251f4ff4caaedee62b15a67db55624 Mon Sep 17 00:00:00 2001 From: Walid Date: Mon, 29 Jan 2024 09:29:00 +0100 Subject: [PATCH] [FIX] stock: print non unit UoM products labels Steps to reproduces: - Create two products one with UoM units and the other grams - Create and confirm an SO with these two products - Set quantities and validate the transfer - Click "Print labels" Bug: only products with UoM units are printed because "quantity_by_product" is overwritten with only those products opw-3658993 closes odoo/odoo#151236 X-original-commit: d3c3e2013bd3ef2fe78c8f27b15daeb633c4d9a0 Signed-off-by: William Henrotin (whe) Signed-off-by: Walid Hanniche (waha) --- addons/stock/wizard/product_label_layout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/wizard/product_label_layout.py b/addons/stock/wizard/product_label_layout.py index 036a759d31d..4c2efd22df6 100644 --- a/addons/stock/wizard/product_label_layout.py +++ b/addons/stock/wizard/product_label_layout.py @@ -42,6 +42,8 @@ class ProductLabelLayout(models.TransientModel): custom_barcodes[line.product_id.id].append((line.lot_id.name or line.lot_name, int(line.quantity))) continue quantities[line.product_id.id] += line.quantity + else: + quantities[line.product_id.id] = 1 # Pass only products with some quantity done to the report data['quantity_by_product'] = {p: int(q) for p, q in quantities.items() if q} data['custom_barcodes'] = custom_barcodes