[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
This commit is contained in:
parent
0f943ef736
commit
fddab4c20d
|
@ -208,15 +208,18 @@ class delivery_grid(osv.osv):
|
||||||
weight = 0
|
weight = 0
|
||||||
volume = 0
|
volume = 0
|
||||||
quantity = 0
|
quantity = 0
|
||||||
|
total_delivery = 0.0
|
||||||
product_uom_obj = self.pool.get('product.uom')
|
product_uom_obj = self.pool.get('product.uom')
|
||||||
for line in order.order_line:
|
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:
|
if not line.product_id or line.is_delivery:
|
||||||
continue
|
continue
|
||||||
q = product_uom_obj._compute_qty(cr, uid, line.product_uom.id, line.product_uom_qty, line.product_id.uom_id.id)
|
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
|
weight += (line.product_id.weight or 0.0) * q
|
||||||
volume += (line.product_id.volume or 0.0) * q
|
volume += (line.product_id.volume or 0.0) * q
|
||||||
quantity += 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)
|
return self.get_price_from_picking(cr, uid, id, total,weight, volume, quantity, context=context)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue