[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 <Whenrow@users.noreply.github.com>
This commit is contained in:
Florian Damhaut
2021-10-15 11:31:49 +00:00
parent 9a4fae9e06
commit 14f2086ea7
+2
View File
@@ -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