From 14f2086ea7da0defcf08fb2faded86f6c67803a2 Mon Sep 17 00:00:00 2001 From: Florian Damhaut Date: Wed, 13 Oct 2021 11:18:26 +0000 Subject: [PATCH] [FIX] delivery : removed service from rule-based delivery quantity Current behaviour : Product of type service are accounted for when computing the quantity, weight and volume metrics used in the price computation of rule based delivery. Planned behaviour : Service-typed product should be excluded from such computations. opw-2647067 closes odoo/odoo#78402 X-original-commit: 2993c82db51e16787de72cbb67f04d5ae1928b68 Signed-off-by: William Henrotin --- addons/delivery/models/delivery_grid.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/delivery/models/delivery_grid.py b/addons/delivery/models/delivery_grid.py index 5f52494ddb3..3e12157f243 100644 --- a/addons/delivery/models/delivery_grid.py +++ b/addons/delivery/models/delivery_grid.py @@ -82,6 +82,8 @@ class ProviderGrid(models.Model): total_delivery += line.price_total if not line.product_id or line.is_delivery: continue + if line.product_id.type == "service": + continue qty = line.product_uom._compute_quantity(line.product_uom_qty, line.product_id.uom_id) weight += (line.product_id.weight or 0.0) * qty volume += (line.product_id.volume or 0.0) * qty