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)