From 20eca78cb9afd6288f5900d4833dc83cbe4fa811 Mon Sep 17 00:00:00 2001 From: jev-odoo Date: Fri, 19 Jul 2019 11:14:14 +0000 Subject: [PATCH] [FIX]delivery_ups: section in SO When there is a sale_order_line that has either no product_id nor product_uom nor product_uom_qty (typically a section line), the computing of the product_qty used in delivery return 0 for each line below that sale_order_line. OPW-2034915 Steps: Create a SO Add some lines One should be a section (not the last line) Save Check product_qty on each line. The lines after the section will have a product_qty = O closes odoo/odoo#35010 Signed-off-by: Lucas Perais (lpe) --- addons/delivery/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py index 08df6ded78f..17dd44bbe74 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -140,7 +140,7 @@ class SaleOrderLine(models.Model): def _compute_product_qty(self): for line in self: if not line.product_id or not line.product_uom or not line.product_uom_qty: - return 0.0 + continue line.product_qty = line.product_uom._compute_quantity(line.product_uom_qty, line.product_id.uom_id) def _is_delivery(self):