From 1971141dc5bcf42c76c092a7d7c8a5069cca8a89 Mon Sep 17 00:00:00 2001 From: buke Date: Mon, 26 May 2014 17:12:38 +0800 Subject: [PATCH] Fixed delivery grid get_price It's wrong for cal weight in delivery gird . It's use product.weight * qty. --- addons/delivery/delivery.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 15a17b36775..c6deb3147a3 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -192,13 +192,14 @@ class delivery_grid(osv.osv): total = 0 weight = 0 volume = 0 + product_uom_obj = self.pool.get('product.uom') for line in order.order_line: if not line.product_id: continue + q = product_uom_obj._compute_qty(cr, uid, line.product_uom.id, line.product_uos_qty, line.product_id.uom_id.id) total += line.price_subtotal or 0.0 - weight += (line.product_id.weight or 0.0) * line.product_uom_qty - volume += (line.product_id.volume or 0.0) * line.product_uom_qty - + weight += (line.product_id.weight or 0.0) * q + volume += (line.product_id.volume or 0.0) * q return self.get_price_from_picking(cr, uid, id, total,weight, volume, context=context)