From fddab4c20d4efb90b81b4ead9a4a307a395b6cb5 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 9 Mar 2015 13:57:52 +0100 Subject: [PATCH] [FIX]delivery: price of a delivery method not correct get_price must check the total_amount price without the delivery amount to compute the delivery prices. opw:629233 --- addons/delivery/delivery.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 295d709e750..4cc7e7d3d53 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -208,15 +208,18 @@ class delivery_grid(osv.osv): weight = 0 volume = 0 quantity = 0 + total_delivery = 0.0 product_uom_obj = self.pool.get('product.uom') for line in order.order_line: + if line.is_delivery: + total_delivery += line.price_subtotal + self.pool['sale.order']._amount_line_tax(cr, uid, line, context=context) if not line.product_id or line.is_delivery: continue q = product_uom_obj._compute_qty(cr, uid, line.product_uom.id, line.product_uom_qty, line.product_id.uom_id.id) weight += (line.product_id.weight or 0.0) * q volume += (line.product_id.volume or 0.0) * q quantity += q - total = order.amount_total or 0.0 + total = (order.amount_total or 0.0) - total_delivery return self.get_price_from_picking(cr, uid, id, total,weight, volume, quantity, context=context)