[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) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
This commit is contained in:
Walid
2024-01-29 10:20:05 +00:00
parent d96298d62d
commit 944f959e74
@@ -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